WC_Brands_Block_Templates::has_block_template()
Fixes a bug regarding taxonomies and FSE. Without this, the system will always load archive-product.php version instead of taxonomy_product_brand.html it will show a deprecation error if that happens.
Triggered by woocommerce_has_block_template filter
Метод класса: WC_Brands_Block_Templates{}
Хуков нет.
Возвращает
true|false
. True if the system is checking archive-product
Использование
$WC_Brands_Block_Templates = new WC_Brands_Block_Templates(); $WC_Brands_Block_Templates->has_block_template( $has_template, $template_name );
- $has_template(true|false) (обязательный)
- True if the template is available.
- $template_name(строка) (обязательный)
- The name of the template.
Код WC_Brands_Block_Templates::has_block_template() WC Brands Block Templates::has block template WC 9.6.1
public function has_block_template( $has_template, $template_name ) { if ( 'archive-product' === $template_name || 'taxonomy-product_brand' === $template_name ) { $has_template = true; } return $has_template; }