WordPress.org

Make WordPress Core

Changeset 22450


Ignore:
Timestamp:
11/07/2012 10:09:05 PM (6 years ago)
Author:
nacin
Message:

Don't call get_term_by() in get_queried_object() if we have no terms. props wonderboymusic. fixes #21967.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r22434 r22450  
    29962996            if ( 'term_id' == $query['field'] )
    29972997                $term = get_term( reset( $query['terms'] ), $query['taxonomy'] );
    2998             else
     2998            elseif ( $query['terms'] )
    29992999                $term = get_term_by( $query['field'], reset( $query['terms'] ), $query['taxonomy'] );
    30003000
    3001             if ( $term && ! is_wp_error($term) )  {
     3001            if ( ! empty( $term ) && ! is_wp_error( $term ) )  {
    30023002                $this->queried_object = $term;
    30033003                $this->queried_object_id = (int) $term->term_id;
Note: See TracChangeset for help on using the changeset viewer.