* Fixed $tax_query being set to an empty array

* Remove whitespace causing PHP coding standards test to fail

* Cleanup: add line break

Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
This commit is contained in:
VoHoTv 2021-07-05 10:48:34 +02:00 committed by GitHub
parent 522f722b2b
commit f3e798d7dd
1 changed files with 3 additions and 3 deletions

View File

@ -41,6 +41,9 @@ class ProductQuery {
$args['post_type'] = [ 'product', 'product_variation' ];
}
// Taxonomy query to filter products by type, category, tag, shipping class, and attribute.
$tax_query = [];
// Filter product type by slug.
if ( ! empty( $request['type'] ) ) {
if ( 'variation' === $request['type'] ) {
@ -88,9 +91,6 @@ class ProductQuery {
}
}
// Taxonomy query to filter products by type, category, tag, shipping class, and attribute.
$tax_query = [];
$operator_mapping = [
'in' => 'IN',
'not_in' => 'NOT IN',