woocommerce_product_form_templates filter-hookWC 9.1.0

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.

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.
Deprecated since 10.9.0 Product editor extension APIs will be removed in WooCommerce 11.0.

Where the hook is called

ProductFormsController::migrate_product_form_posts()
woocommerce_product_form_templates
woocommerce/src/Admin/Features/ProductBlockEditor/ProductFormsController.php 93-96
$templates = apply_filters(
	'woocommerce_product_form_templates',
	$this->product_form_templates
);

Where the hook is used in WooCommerce

Usage not found.