woocommerce_is_filtered │ хук-фильтр │ WC 2.1.0

Filters whether products are currently being filtered by layered nav, price or rating.

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

add_filter( 'woocommerce_is_filtered', 'wp_kama_woocommerce_is_filtered_filter' );

/**
 * Function for `woocommerce_is_filtered` filter-hook.
 * 
 * @param bool $is_filtered Whether a product filter is active.
 *
 * @return bool
 */
function wp_kama_woocommerce_is_filtered_filter( $is_filtered ){
	// filter...
	return $is_filtered;
}
$is_filtered(true|false)
Whether a product filter is active.

Список изменений

С версии 2.1.0 Введена.

Где вызывается хук

is_filtered()
woocommerce_is_filtered
woocommerce/includes/wc-conditional-functions.php 365
return apply_filters( 'woocommerce_is_filtered', ( count( WC_Query::get_layered_nav_chosen_attributes() ) > 0 || isset( $_GET['max_price'] ) || isset( $_GET['min_price'] ) || isset( $_GET['rating_filter'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only presence checks on public catalog filter parameters; nothing is written.

Где используется хук в WooCommerce

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