WooCommerce Code Reference

WC_Post_Types

Post types Class.

Table of Contents

flush_rewrite_rules()  : mixed
Flush rewrite rules.
gutenberg_can_edit_post_type()  : bool
Disable Gutenberg for products.
init()  : mixed
Hook in methods.
maybe_flush_rewrite_rules()  : mixed
Flush rules if the event is queued.
register_post_status()  : mixed
Register our custom post statuses, used for order status.
register_post_types()  : mixed
Register core post types.
register_taxonomies()  : mixed
Register core taxonomies.
rest_api_allowed_post_types()  : array<string|int, mixed>
Added product for Jetpack related posts.
support_jetpack_omnisearch()  : mixed
Add Product Support to Jetpack Omnisearch.
updated_term_messages()  : bool
Customize taxonomies update messages.

Methods

gutenberg_can_edit_post_type()

Disable Gutenberg for products.

public static gutenberg_can_edit_post_type(bool $can_edit, string $post_type) : bool
Parameters
$can_edit : bool

Whether the post type can be edited or not.

$post_type : string

The post type being checked.

Return values
bool

maybe_flush_rewrite_rules()

Flush rules if the event is queued.

public static maybe_flush_rewrite_rules() : mixed
Tags
since
3.3.0
Return values
mixed

register_post_status()

Register our custom post statuses, used for order status.

public static register_post_status() : mixed
Return values
mixed

rest_api_allowed_post_types()

Added product for Jetpack related posts.

public static rest_api_allowed_post_types(array<string|int, mixed> $post_types) : array<string|int, mixed>
Parameters
$post_types : array<string|int, mixed>

Post types.

Return values
array<string|int, mixed>

support_jetpack_omnisearch()

Add Product Support to Jetpack Omnisearch.

public static support_jetpack_omnisearch() : mixed
Return values
mixed

updated_term_messages()

Customize taxonomies update messages.

public static updated_term_messages(array<string|int, mixed> $messages) : bool
Parameters
$messages : array<string|int, mixed>

The list of available messages.

Tags
since
4.4.0
Return values
bool