Server IP : 104.21.14.103 / Your IP : 13.58.161.216 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/giankuin/khowordpress.com/wp-content/plugins/woocommerce/src/Blocks/Templates/ |
Upload File : |
<?php namespace Automattic\WooCommerce\Blocks\Templates; /** * ProductSearchResultsTemplate class. * * @internal */ class ProductSearchResultsTemplate { const SLUG = 'product-search-results'; /** * Constructor. */ public function __construct() { $this->init(); } /** * Initialization method. */ protected function init() { add_filter( 'search_template_hierarchy', array( $this, 'update_search_template_hierarchy' ), 10, 3 ); } /** * When the search is for products and a block theme is active, render the Product Search Template. * * @param array $templates Templates that match the search hierarchy. */ 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; } }