woocommerce_product_form_templates
Allow extend the list of templates that should be auto-generated.
Usage
add_filter( 'woocommerce_product_form_templates', 'wp_kama_woocommerce_product_form_templates_filter' );
/**
* Function for `woocommerce_product_form_templates` filter-hook.
*
* @param array $templates List of templates to auto-generate.
*
* @return array
*/
function wp_kama_woocommerce_product_form_templates_filter( $templates ){
// filter...
return $templates;
}
- $templates(array)
- List of templates to auto-generate.
Changelog
| Since 9.1.0 | Introduced. |
Where the hook is called
woocommerce_product_form_templates
woocommerce/src/Admin/Features/ProductBlockEditor/ProductFormsController.php 76-79
$templates = apply_filters( 'woocommerce_product_form_templates', $this->product_form_templates );