woocommerce_product_editor_product_templates
Allows for new product template registration.
Usage
add_filter( 'woocommerce_product_editor_product_templates', 'wp_kama_woocommerce_product_editor_templates_filter' ); /** * Function for `woocommerce_product_editor_product_templates` filter-hook. * * @param $default_product_templates * * @return */ function wp_kama_woocommerce_product_editor_templates_filter( $default_product_templates ){ // filter... return $default_product_templates; }
- $default_product_templates
- -
Changelog
Since 8.5.0 | Introduced. |
Where the hook is called
woocommerce_product_editor_product_templates
woocommerce/src/Admin/Features/ProductBlockEditor/Init.php 409
$this->product_templates = apply_filters( 'woocommerce_product_editor_product_templates', $this->get_default_product_templates() );