woocommerce_product_editor_product_templates
Deprecated since 10.9.0 Product editor extension APIs will be removed in WooCommerce 11.0.. It is no longer supported and may be removed in future releases. It is recommended to replace this hook with the same one.
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. |
| Deprecated since 10.9.0 | Product editor extension APIs will be removed in WooCommerce 11.0. |
Where the hook is called
woocommerce_product_editor_product_templates
woocommerce/src/Admin/Features/ProductBlockEditor/Init.php 436
$this->product_templates = apply_filters( 'woocommerce_product_editor_product_templates', $this->get_default_product_templates() );