WordPress filter hook
woocommerce_shortcode_products_query
Defined by WooCommerce and fired by 21 plugins in total, running on 7.2M+ sites between them.
How to use woocommerce_shortcode_products_query
It's a filter: your callback receives the value and 2 more arguments, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_shortcode_products_query', function( $query_args, $attributes, $type ) {
// Change $query_args here.
return $query_args;
}, 10, 3 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
21 plugins that fire woocommerce_shortcode_products_query
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type )includes/shortcodes/class-wc-shortcode-products.php:237 -
ShopEngine90,000+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type )widgets/shop.php:119 -
ShopLentor80,000+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type )includes/archive_product_render.php:155 -
DethemeKit for Elementor30,000+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type )modules/woocommerce/classes/products-renderer.php:118 -
LA-Studio Element Kit for Elementor10,000+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type )includes/modules/woocommerce/classes/products-renderer.php:233 -
MAS Brands for WooCommerce10,000+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $atts, $loop_name )includes/class-mas-wc-brands-shortcodes.php:293 -
Discount Rules and Dynamic Pricing for WooCommerce9,000+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, array(), 'products' )public/class-wccs-public-products-list.php:112 -
Category AJAX Filter6,000+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, array(), 'products' )includes/frontend/class-caf-builder-main-query.php:1482 -
Brands for WooCommerce5,000+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $atts, $loop_name )main.php:285 -
Responsive Addons for Elementor3,000+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type )includes/widgets-manager/modules/woocommerce/classes/class-products-renderer.php:152 -
WC Builder1,000+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type )includes/archive-product-render.php:114 -
Products Compare for WooCommerce1,000+ installs
apply_filters( 'woocommerce_shortcode_products_query', array('post_type' => 'product', 'fields' => 'ids', 'post__in' => $products), array(), 'products' )templates/new-compare.php:21 -
MDTF900+ installs
apply_filters( 'woocommerce_shortcode_products_query', $args, $atts, "" )classes/shortcodes.php:651 -
MAS Elementor800+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type )modules/woocommerce/classes/products-renderer.php:166 -
StoreBuild400+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type )includes/class-pure-wc-shopbuild-products-shortcode.php:242 -
core plugin for kitestudio themes300+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $atts )includes/elements/shortcodes/woocommerce/product-loop.php:200 -
Stax Addons for WooCommerce and Elementor100+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type )core/woocommerce/ProductsRenderer.php:121 -
TABLEiT20+ installs
apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type )class-wc-shortcode-product-table.php:1045 -
X-tra Ordinary WooCommerce Product Carousel and Slider20+ installs
apply_filters( 'woocommerce_shortcode_products_query', $args, $atts )public/class-xox-woo-carousel-public.php:423 -
Trendmag Toolkit10+ installs
apply_filters( 'woocommerce_shortcode_products_query', $args, $atts )inc/widgets/woocomerce/list-products.php:222 -
Maxi Woo Ajax Navigation10+ installs
apply_filters( 'woocommerce_shortcode_products_query', $args, $atts )public/class-waj-public.php:184
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.