Automattic\WooCommerce\Blocks\Templates
ProductSearchResultsTemplate::update_search_template_hierarchy()
When the search is for products and a block theme is active, render the Product Search Template.
Метод класса: ProductSearchResultsTemplate{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$ProductSearchResultsTemplate = new ProductSearchResultsTemplate(); $ProductSearchResultsTemplate->update_search_template_hierarchy( $templates );
- $templates(массив) (обязательный)
- Templates that match the search hierarchy.
Код ProductSearchResultsTemplate::update_search_template_hierarchy() ProductSearchResultsTemplate::update search template hierarchy WC 7.7.0
public function update_search_template_hierarchy( $templates ) { if ( ( is_search() && is_post_type_archive( 'product' ) ) && wc_current_theme_is_fse_theme() ) { array_unshift( $templates, self::SLUG ); } return $templates; }