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

git-svn-id: http://svn.automattic.com/wordpress/trunk@16116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-10-31 11:28:49 +00:00
parent b890848aaa
commit 7f7d5e3c75
1 changed files with 7 additions and 11 deletions

View File

@ -1901,21 +1901,17 @@ 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);
$this->set( 'cat', $cat->term_id );
$this->set( 'category_name', $cat->slug );
}
}
}
unset( $ids );
}
if ( !empty($q['meta_key']) ) {
$groupby = "{$wpdb->posts}.ID";
}