Automattic\WooCommerce\Blocks\Templates

ProductSearchResultsTemplate::update_search_template_hierarchy()publicWC 1.0

When the search is for products and a block theme is active, render the Product Search Template.

Метод класса: ProductSearchResultsTemplate{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$ProductSearchResultsTemplate = new ProductSearchResultsTemplate();
$ProductSearchResultsTemplate->update_search_template_hierarchy( $templates );
$templates(массив) (обязательный)
Templates that match the search hierarchy.

Код ProductSearchResultsTemplate::update_search_template_hierarchy() WC 8.9.3

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