X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/78ff9d91a14da1f53bd3f1ffcab1264d92359b72..a349837896628462bf8c9bdc27d1477a10fe03eb:/wp-includes/query.php diff --git a/wp-includes/query.php b/wp-includes/query.php index 8bf292e1..446cebca 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -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 );