diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php
index 953f917d27..e8b653357d 100644
a
|
b
|
class WP_Query { |
1096 | 1096 | continue; // Handled further down in the $q['tag'] block |
1097 | 1097 | } |
1098 | 1098 | |
1099 | | if ( $t->query_var && ! empty( $q[ $t->query_var ] ) ) { |
| 1099 | if ( $t->query_var && isset( $q[ $t->query_var ] ) && '' != $q[ $t->query_var ] ) { |
1100 | 1100 | $tax_query_defaults = array( |
1101 | 1101 | 'taxonomy' => $taxonomy, |
1102 | 1102 | 'field' => 'slug', |
diff --git a/src/wp-includes/class-wp-tax-query.php b/src/wp-includes/class-wp-tax-query.php
index 03e904c670..4f6ccfb564 100644
a
|
b
|
class WP_Tax_Query { |
601 | 601 | $resulting_field = sanitize_key( $resulting_field ); |
602 | 602 | |
603 | 603 | // Empty 'terms' always results in a null transformation. |
604 | | $terms = array_filter( $query['terms'] ); |
| 604 | $terms = array_filter( $query['terms'], function( $term ) { return ( 0 !== strlen( trim( $term ) ) ); } ); |
605 | 605 | if ( empty( $terms ) ) { |
606 | 606 | $query['terms'] = array(); |
607 | 607 | $query['field'] = $resulting_field; |