remove the WP main query check

This commit is contained in:
Ron Rennick 2019-01-31 13:29:38 -04:00
parent 9855a18036
commit e1213f8432
1 changed files with 1 additions and 3 deletions

View File

@ -598,12 +598,10 @@ class WC_Query {
* @return array * @return array
*/ */
public function get_meta_query( $meta_query = array(), $main_query = false ) { public function get_meta_query( $meta_query = array(), $main_query = false ) {
global $wp_query;
if ( ! is_array( $meta_query ) ) { if ( ! is_array( $meta_query ) ) {
$meta_query = array(); $meta_query = array();
} }
if ( $main_query || $wp_query === self::$product_query ) { if ( $main_query ) {
$meta_query['price_filter'] = $this->price_filter_meta_query(); $meta_query['price_filter'] = $this->price_filter_meta_query();
} }
return array_filter( apply_filters( 'woocommerce_product_query_meta_query', $meta_query, $this ) ); return array_filter( apply_filters( 'woocommerce_product_query_meta_query', $meta_query, $this ) );