WC_Template_Loader::taxonomy_has_block_template()
Checks whether a block template for a given taxonomy exists.
Note: This checks both the templates and block-templates directories as both conventions should be supported.
Метод класса: WC_Template_Loader{}
Хуков нет.
Возвращает
true|false
.
Использование
$result = WC_Template_Loader::taxonomy_has_block_template( $taxonomy ) : bool;
- $taxonomy(объект) (обязательный)
- Object taxonomy to check.
Код WC_Template_Loader::taxonomy_has_block_template() WC Template Loader::taxonomy has block template WC 9.4.2
private static function taxonomy_has_block_template( $taxonomy ) : bool { if ( taxonomy_is_product_attribute( $taxonomy->taxonomy ) ) { $template_name = 'taxonomy-product_attribute'; } else { $template_name = 'taxonomy-' . $taxonomy->taxonomy; } return self::has_block_template( $template_name ); }