diff --git a/wp-includes/query.php b/wp-includes/query.php index c38a11c083..27d8c26fa4 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -3900,15 +3900,17 @@ class WP_Query { // For other tax queries, grab the first term from the first clause. $tax_query_in_and = wp_list_filter( $this->tax_query->queried_terms, array( 'operator' => 'NOT IN' ), 'NOT' ); - $queried_taxonomies = array_keys( $tax_query_in_and ); - $matched_taxonomy = reset( $queried_taxonomies ); - $query = $tax_query_in_and[ $matched_taxonomy ]; + if ( ! empty( $tax_query_in_and ) ) { + $queried_taxonomies = array_keys( $tax_query_in_and ); + $matched_taxonomy = reset( $queried_taxonomies ); + $query = $tax_query_in_and[ $matched_taxonomy ]; - if ( $query['terms'] ) { - if ( 'term_id' == $query['field'] ) { - $term = get_term( reset( $query['terms'] ), $matched_taxonomy ); - } else { - $term = get_term_by( $query['field'], reset( $query['terms'] ), $matched_taxonomy ); + if ( $query['terms'] ) { + if ( 'term_id' == $query['field'] ) { + $term = get_term( reset( $query['terms'] ), $matched_taxonomy ); + } else { + $term = get_term_by( $query['field'], reset( $query['terms'] ), $matched_taxonomy ); + } } } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 5807318907..2d54940304 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31365'; +$wp_version = '4.2-alpha-31366'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.