In WP_Query::get_queried_object()
, move the check for $query['terms']
to a place where $query
is actually set. This should be included if [26864] makes it into 3.8.1.
Props SergeyBiryukov. See #26728, [26864], #26634, #26627. git-svn-id: https://develop.svn.wordpress.org/trunk@26874 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
af9a2ca5e5
commit
f8338aa3c3
@ -3271,14 +3271,17 @@ class WP_Query {
|
||||
}
|
||||
} elseif ( $this->is_tag ) {
|
||||
$term = get_term( $this->get( 'tag_id' ), 'post_tag' );
|
||||
} elseif ( $query['terms'] ) {
|
||||
} else {
|
||||
$tax_query_in_and = wp_list_filter( $this->tax_query->queries, array( 'operator' => 'NOT IN' ), 'NOT' );
|
||||
$query = reset( $tax_query_in_and );
|
||||
|
||||
if ( 'term_id' == $query['field'] )
|
||||
$term = get_term( reset( $query['terms'] ), $query['taxonomy'] );
|
||||
else
|
||||
$term = get_term_by( $query['field'], reset( $query['terms'] ), $query['taxonomy'] );
|
||||
if ( $query['terms'] ) {
|
||||
if ( 'term_id' == $query['field'] ) {
|
||||
$term = get_term( reset( $query['terms'] ), $query['taxonomy'] );
|
||||
} else {
|
||||
$term = get_term_by( $query['field'], reset( $query['terms'] ), $query['taxonomy'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $term ) && ! is_wp_error( $term ) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user