Query: Avoid PHP notice in get_queried_object() when query contains NOT EXISTS tax query.

Props johnjamesjacoby.
See #37962.

git-svn-id: https://develop.svn.wordpress.org/trunk@38585 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2016-09-09 19:36:22 +00:00
parent 6c8c98fe5b
commit 6adcd15435
2 changed files with 20 additions and 1 deletions

View File

@@ -3264,7 +3264,7 @@ class WP_Query {
$matched_taxonomy = reset( $queried_taxonomies );
$query = $tax_query_in_and[ $matched_taxonomy ];
if ( $query['terms'] ) {
if ( ! empty( $query['terms'] ) ) {
if ( 'term_id' == $query['field'] ) {
$term = get_term( reset( $query['terms'] ), $matched_taxonomy );
} else {