Merge pull request #13844 from woocommerce/fix-13839
[REST API] Ignore 0 category while querying products
This commit is contained in:
commit
5d62d3c844
|
@ -151,6 +151,10 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
|
||||
// Set tax_query for each passed arg.
|
||||
foreach ( $taxonomies as $taxonomy => $key ) {
|
||||
if ( ! empty( $request[ $key ] ) && is_array( $request[ $key ] ) ) {
|
||||
$request[ $key ] = array_filter( $request[ $key ] );
|
||||
}
|
||||
|
||||
if ( ! empty( $request[ $key ] ) ) {
|
||||
$tax_query[] = array(
|
||||
'taxonomy' => $taxonomy,
|
||||
|
|
Loading…
Reference in New Issue