woocommerce_register_post_type_product_variation
Usage
add_filter( 'woocommerce_register_post_type_product_variation', 'wp_kama_woocommerce_register_post_type_product_variation_filter' ); /** * Function for `woocommerce_register_post_type_product_variation` filter-hook. * * @param $array * * @return */ function wp_kama_woocommerce_register_post_type_product_variation_filter( $array ){ // filter... return $array; }
- $array
- -
Where the hook is called
woocommerce_register_post_type_product_variation
woocommerce/includes/class-wc-post-types.php 444-454
apply_filters( 'woocommerce_register_post_type_product_variation', array( 'label' => __( 'Variations', 'woocommerce' ), 'public' => false, 'hierarchical' => false, 'supports' => false, 'capability_type' => 'product', 'rewrite' => false, ) )
Where the hook is used in WooCommerce
woocommerce/src/Admin/Features/ProductBlockEditor/Init.php 65
add_filter( 'woocommerce_register_post_type_product_variation', array( $this, 'enable_rest_api_for_product_variation' ) );