__experimental_woocommerce_(product_type)_add_to_cart_with_options_block_template_part
Experimental filter for extensions to register a block template part for a product type.
Usage
add_filter( '__experimental_woocommerce_(product_type)_add_to_cart_with_options_block_template_part', 'wp_kama__experimental_woocommerce_product_type_add_to_cart_with_options_block_template_part_filter', 10, 2 );
/**
* Function for `__experimental_woocommerce_(product_type)_add_to_cart_with_options_block_template_part` filter-hook.
*
* @param string|boolean $template_part_path The template part path if it exists
* @param string $product_type The product type
*
* @return string|boolean
*/
function wp_kama__experimental_woocommerce_product_type_add_to_cart_with_options_block_template_part_filter( $template_part_path, $product_type ){
// filter...
return $template_part_path;
}
- $template_part_path(string|true|false)
- The template part path if it exists
- $product_type(string)
- The product type
Changelog
| Since 9.9.0 | Introduced. |
Where the hook is called
__experimental_woocommerce_(product_type)_add_to_cart_with_options_block_template_part
woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/AddToCartWithOptions.php 46
return apply_filters( '__experimental_woocommerce_' . $product_type . '_add_to_cart_with_options_block_template_part', false, $product_type );