__experimental_woocommerce_(product_type)_add_to_cart_with_options_block_template_part хук-фильтрWC 9.9.0

Filter to declare product type's cart block template is supported.

Использование

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 mixed  $false        string|boolean The template part path if it exists
 * @param string $product_type The product type
 *
 * @return mixed
 */
function wp_kama__experimental_woocommerce_product_type_add_to_cart_with_options_block_template_part_filter( $false, $product_type ){

	// filter...
	return $false;
}
$false(разное)
string|boolean The template part path if it exists
$product_type(строка)
The product type

Список изменений

С версии 9.9.0 Введена.

Где вызывается хук

AddToCartWithOptions::render()
__experimental_woocommerce_(product_type)_add_to_cart_with_options_block_template_part
woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/AddToCartWithOptions.php 142
$template_part_path = apply_filters( '__experimental_woocommerce_' . $product_type . '_add_to_cart_with_options_block_template_part', false, $product_type );

Где используется хук в WooCommerce

Использование не найдено.