woocommerce_is_filtered
Is_filtered - Returns true when filtering products using layered nav or price sliders.
Usage
add_filter( 'woocommerce_is_filtered', 'wp_kama_woocommerce_is_filtered_filter' ); /** * Function for `woocommerce_is_filtered` filter-hook. * * @param $condition * * @return */ function wp_kama_woocommerce_is_filtered_filter( $condition ){ // filter... return $condition; }
- $condition
- -
Where the hook is called
woocommerce_is_filtered
woocommerce/includes/wc-conditional-functions.php 292
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'] ) ) ); // WPCS: CSRF ok.