product_loop on shortcodes
-
some WooCommerce shortcodes are using function product_loop.
To alter the loop, we have a filter woocommerce_shortcode_products_query.
This is great. But there’s a problem, there’s no way to tell which shortcode to apply the filter.if only this
$products = new WP_Query( apply_filters( 'woocommerce_shortcode_products_query', $query_args, $atts ) );
can be changed to something like this
$products = new WP_Query( apply_filters( 'woocommerce_shortcode_products_query', $query_args, $atts, $loop_name ) );
This way I can have a conditional statement checking for
$loop_name
.
- The topic ‘product_loop on shortcodes’ is closed to new replies.