mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 18:13:00 +01:00
Don't call get_term_by() in get_queried_object() if we have no terms. props wonderboymusic. fixes #21967.
git-svn-id: https://develop.svn.wordpress.org/trunk@22450 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
117dd15e79
commit
a2082dcf2b
@ -2995,10 +2995,10 @@ class WP_Query {
|
||||
|
||||
if ( 'term_id' == $query['field'] )
|
||||
$term = get_term( reset( $query['terms'] ), $query['taxonomy'] );
|
||||
else
|
||||
elseif ( $query['terms'] )
|
||||
$term = get_term_by( $query['field'], reset( $query['terms'] ), $query['taxonomy'] );
|
||||
|
||||
if ( $term && ! is_wp_error($term) ) {
|
||||
if ( ! empty( $term ) && ! is_wp_error( $term ) ) {
|
||||
$this->queried_object = $term;
|
||||
$this->queried_object_id = (int) $term->term_id;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user