WordPress filter hook
woocommerce_layered_nav_default_query_type
Defined by WooCommerce and fired by 7 plugins in total, running on 7.2M+ sites between them.
“This filter is documented in woocommerce/includes/class-wc-query.php”
How to use woocommerce_layered_nav_default_query_type
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_layered_nav_default_query_type', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
7 plugins that fire woocommerce_layered_nav_default_query_type
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_layered_nav_default_query_type', 'and' )includes/class-wc-query.php:1128 -
Relevanssi100,000+ installs
apply_filters( 'woocommerce_layered_nav_default_query_type', 'and' )lib/compatibility/woocommerce.php:204 -
YITH WooCommerce Ajax Product Filter70,000+ installs
apply_filters( 'woocommerce_layered_nav_default_query_type', 'and' )includes/class-yith-wcan-query.php:820 -
StoreBuild400+ installs
apply_filters( 'woocommerce_layered_nav_default_query_type', 'and' )includes/class-pure-wc-shopbuild-products-shortcode.php:146 -
Ajaxify Filters10+ installs
apply_filters( 'woocommerce_layered_nav_default_query_type', 'and' )helper/class-ced-caf-attribute-filter-helper.php:53 -
Rooster One10+ installs
apply_filters( 'woocommerce_layered_nav_default_query_type', 'and' )includes/class-aieo-intent-render.php:209 -
Opuswerk Filter Landing Pages for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_layered_nav_default_query_type', 'and' )includes/dialects/class-wc-native-dialect.php:266
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.