WordPress 3.8.2
[autoinstalls/wordpress.git] / wp-includes / query.php
index 8bf292e1fe4b9412b5e28539d49d069d37c8b30b..446cebca0d83de1d140e87bed534c72e92b28651 100644 (file)
@@ -3273,7 +3273,11 @@ class WP_Query {
                                        $term = get_term_by( 'slug', $this->get( 'category_name' ), 'category' );
                                }
                        } elseif ( $this->is_tag ) {
-                               $term = get_term( $this->get( 'tag_id' ), 'post_tag' );
+                               if ( $this->get( 'tag_id' ) ) {
+                                       $term = get_term( $this->get( 'tag_id' ), 'post_tag' );
+                               } elseif ( $this->get( 'tag' ) ) {
+                                       $term = get_term_by( 'slug', $this->get( 'tag' ), 'post_tag' );
+                               }
                        } else {
                                $tax_query_in_and = wp_list_filter( $this->tax_query->queries, array( 'operator' => 'NOT IN' ), 'NOT' );
                                $query = reset( $tax_query_in_and );