is_filtered() │ WC 1.0

Is_filtered - Returns true when filtering products using layered nav or price sliders.

Hooks from the function

Returns

bool.

Usage

is_filtered();

is_filtered() code WC 11.2.1

function is_filtered() {
	/**
	 * Filters whether products are currently being filtered by layered nav, price or rating.
	 *
	 * @since 2.1.0
	 * @param bool $is_filtered Whether a product filter is active.
	 */
	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.
}