WC_Template_Loader::taxonomy_has_block_template()private staticWC 1.0

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.

Method of the class: WC_Template_Loader{}

No Hooks.

Return

true|false.

Usage

$result = WC_Template_Loader::taxonomy_has_block_template( $taxonomy ) : bool;
$taxonomy(object) (required)
Object taxonomy to check.

WC_Template_Loader::taxonomy_has_block_template() code WC 8.7.0

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 );
}