WC_Post_Types::init
Hook in methods.
Method of the class: WC_Post_Types{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Post_Types::init();
WC_Post_Types::init() WC Post Types::init code WC 11.0.1
public static function init() {
add_action( 'init', array( __CLASS__, 'register_taxonomies' ), 5 );
add_action( 'init', array( __CLASS__, 'register_post_types' ), 5 );
add_action( 'init', array( __CLASS__, 'register_post_status' ), 9 );
add_action( 'init', array( __CLASS__, 'support_jetpack_omnisearch' ) );
add_filter( 'term_updated_messages', array( __CLASS__, 'updated_term_messages' ) );
add_filter( 'rest_api_allowed_post_types', array( __CLASS__, 'rest_api_allowed_post_types' ) );
add_action( 'woocommerce_after_register_post_type', array( __CLASS__, 'maybe_flush_rewrite_rules' ) );
add_action( 'woocommerce_flush_rewrite_rules', array( __CLASS__, 'flush_rewrite_rules' ) );
// Similar logic exists in flush_rewrite_rules_on_shop_page_save(), but REST saves need a queued flush.
add_action(
'save_post_page',
static function ( $post_id, $post, $update ) {
if ( ! $update ) {
return;
}
self::queue_rewrite_rules_on_shop_page_save( $post_id, $post );
},
10,
3
);
add_filter( 'gutenberg_can_edit_post_type', array( __CLASS__, 'gutenberg_can_edit_post_type' ), 10, 2 );
add_filter( 'use_block_editor_for_post_type', array( __CLASS__, 'gutenberg_can_edit_post_type' ), 10, 2 );
}