Merge pull request #20915 from stromhalm/master

Merging plugin's tax_queries on REST endpoint, fixes #20914
This commit is contained in:
Claudiu Lodromanean 2018-07-27 06:52:17 -07:00 committed by GitHub
commit 075cbd156e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -236,8 +236,13 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
}
}
// Build tax_query if taxonomies are set.
if ( ! empty( $tax_query ) ) {
$args['tax_query'] = $tax_query; // WPCS: slow query ok.
if ( ! empty( $args['tax_query'] ) ) {
$args['tax_query'] = array_merge( $tax_query, $args['tax_query'] ); // WPCS: slow query ok.
} else {
$args['tax_query'] = $tax_query; // WPCS: slow query ok.
}
}
// Filter featured.