Automattic\WooCommerce\Blocks\Templates
ProductAttributeTemplate::update_taxonomy_template_hierarchy()
Renders the Product by Attribute template for product attributes taxonomy pages.
Method of the class: ProductAttributeTemplate{}
No Hooks.
Return
null
. Nothing (null).
Usage
$ProductAttributeTemplate = new ProductAttributeTemplate(); $ProductAttributeTemplate->update_taxonomy_template_hierarchy( $templates );
- $templates(array) (required)
- Templates that match the product attributes taxonomy.
ProductAttributeTemplate::update_taxonomy_template_hierarchy() ProductAttributeTemplate::update taxonomy template hierarchy code WC 9.6.1
public function update_taxonomy_template_hierarchy( $templates ) { $queried_object = get_queried_object(); if ( taxonomy_is_product_attribute( $queried_object->taxonomy ) && wc_current_theme_is_fse_theme() ) { array_splice( $templates, count( $templates ) - 1, 0, self::SLUG ); } return $templates; }