Ticket #16465: 16465.diff
File 16465.diff, 1.6 KB (added by , 11 years ago) |
---|
-
wp-includes/query.php
2256 2256 } 2257 2257 2258 2258 $cat_query = wp_list_filter( $tax_query_in_and, array( 'taxonomy' => 'category' ) ); 2259 if ( ! empty( $cat_query ) ) {2259 if ( ! empty( $cat_query ) ) { 2260 2260 $cat_query = reset( $cat_query ); 2261 $the_cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' ); 2262 if ( $the_cat ) { 2263 $this->set( 'cat', $the_cat->term_id ); 2264 $this->set( 'category_name', $the_cat->slug ); 2261 2262 if ( ! empty( $cat_query['terms'][0] ) ) { 2263 $the_cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' ); 2264 if ( $the_cat ) { 2265 $this->set( 'cat', $the_cat->term_id ); 2266 $this->set( 'category_name', $the_cat->slug ); 2267 } 2268 unset( $the_cat ); 2265 2269 } 2266 unset( $the_cat );2267 2270 } 2268 2271 unset( $cat_query ); 2269 2272 2270 2273 $tag_query = wp_list_filter( $tax_query_in_and, array( 'taxonomy' => 'post_tag' ) ); 2271 if ( ! empty( $tag_query ) ) {2274 if ( ! empty( $tag_query ) ) { 2272 2275 $tag_query = reset( $tag_query ); 2273 $the_tag = get_term_by( $tag_query['field'], $tag_query['terms'][0], 'post_tag' ); 2274 if ( $the_tag ) { 2275 $this->set( 'tag_id', $the_tag->term_id ); 2276 2277 if ( ! empty( $tag_query['terms'][0] ) ) { 2278 $the_tag = get_term_by( $tag_query['field'], $tag_query['terms'][0], 'post_tag' ); 2279 if ( $the_tag ) 2280 $this->set( 'tag_id', $the_tag->term_id ); 2281 unset( $the_tag ); 2276 2282 } 2277 unset( $the_tag );2278 2283 } 2279 2284 unset( $tag_query ); 2280 2285 }