Make WordPress Core


Ignore:
Timestamp:
03/21/2014 05:20:52 PM (10 years ago)
Author:
nacin
Message:

In WP_Query::get_queried_object(), account for pre_get_posts by checking for tag when tag_id isn't present.

Merges [27511] to the 3.8 branch.

props mattonomics, wonderboymusic.
fixes #27362.

Location:
branches/3.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.8

  • branches/3.8/src/wp-includes/query.php

    r26951 r27647  
    32743274                }
    32753275            } elseif ( $this->is_tag ) {
    3276                 $term = get_term( $this->get( 'tag_id' ), 'post_tag' );
     3276                if ( $this->get( 'tag_id' ) ) {
     3277                    $term = get_term( $this->get( 'tag_id' ), 'post_tag' );
     3278                } elseif ( $this->get( 'tag' ) ) {
     3279                    $term = get_term_by( 'slug', $this->get( 'tag' ), 'post_tag' );
     3280                }
    32773281            } else {
    32783282                $tax_query_in_and = wp_list_filter( $this->tax_query->queries, array( 'operator' => 'NOT IN' ), 'NOT' );
Note: See TracChangeset for help on using the changeset viewer.