Remove check on unexistant $ids var in WP_Query::get_posts. Props Utkarsh. See #12891

git-svn-id: https://develop.svn.wordpress.org/trunk@16116 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu 2010-10-31 11:28:49 +00:00
parent 58f4333233
commit 33e3ef1367
1 changed files with 7 additions and 11 deletions

View File

@ -1901,19 +1901,15 @@ class WP_Query extends WP_Object_Query {
$where .= $this->get_tax_sql( $q['tax_query'], "$wpdb->posts.ID" );
// Back-compat
if ( !empty( $ids ) ) {
$cat_query = wp_list_filter( $q['tax_query'], array( 'taxonomy' => 'category' ) );
if ( !empty( $cat_query ) ) {
$cat_query = reset( $cat_query );
$cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' );
if ( $cat ) {
$this->set('cat', $cat->term_id);
$this->set('category_name', $cat->slug);
}
$cat_query = wp_list_filter( $q['tax_query'], array( 'taxonomy' => 'category' ) );
if ( !empty( $cat_query ) ) {
$cat_query = reset( $cat_query );
$cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' );
if ( $cat ) {
$this->set( 'cat', $cat->term_id );
$this->set( 'category_name', $cat->slug );
}
}
unset( $ids );
}
if ( !empty($q['meta_key']) ) {