Automattic\WooCommerce\Blocks\Templates

ClassicTemplatesCompatibility::set_filterable_product_data()publicWC 1.0

This method passes the value has_filterable_products to the front-end for product archive pages, so that widget product filter blocks are aware of the context they are in and can render accordingly.

{} Это метод класса: ClassicTemplatesCompatibility{}

Хуков нет.

Возвращает

null. Ничего.

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

$ClassicTemplatesCompatibility = new ClassicTemplatesCompatibility();
$ClassicTemplatesCompatibility->set_filterable_product_data();

Код ClassicTemplatesCompatibility::set_filterable_product_data() WC 6.9.4

public function set_filterable_product_data() {
	global $pagenow;

	if ( is_shop() || is_product_taxonomy() || 'widgets.php' === $pagenow ) {
		$this->asset_data_registry->add( 'has_filterable_products', true, true );
	}
}