woocommerce_has_block_template хук-фильтрWC .

Filters the value of the result of the block template check.

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

add_filter( 'woocommerce_has_block_template', 'wp_kama_woocommerce_has_block_template_filter', 10, 2 );

/**
 * Function for `woocommerce_has_block_template` filter-hook.
 * 
 * @param boolean $has_template  value to be filtered.
 * @param string  $template_name The name of the template.
 *
 * @return boolean
 */
function wp_kama_woocommerce_has_block_template_filter( $has_template, $template_name ){

	// filter...
	return $has_template;
}
$has_template(true|false)
value to be filtered.
$template_name(строка)
The name of the template.

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

С версии . Введена.
Since x.x.x

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

WC_Template_Loader::has_block_template()
woocommerce_has_block_template
woocommerce/includes/class-wc-template-loader.php 171
return (bool) apply_filters( 'woocommerce_has_block_template', $has_template, $template_name );

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

woocommerce/packages/woocommerce-blocks/src/BlockTemplatesController.php 526
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
woocommerce/packages/woocommerce-blocks/src/BlockTemplatesController.php 532
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
woocommerce/packages/woocommerce-blocks/src/BlockTemplatesController.php 538
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
woocommerce/packages/woocommerce-blocks/src/BlockTemplatesController.php 544
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );
woocommerce/packages/woocommerce-blocks/src/BlockTemplatesController.php 555
add_filter( 'woocommerce_has_block_template', '__return_true', 10, 0 );