WordPress.org

Make WordPress Core

Changeset 16116


Ignore:
Timestamp:
10/31/2010 11:28:49 AM (9 years ago)
Author:
scribu
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r16091 r16116  
    19021902
    19031903            // Back-compat
    1904             if ( !empty( $ids ) ) {
    1905                 $cat_query = wp_list_filter( $q['tax_query'], array( 'taxonomy' => 'category' ) );
    1906                 if ( !empty( $cat_query ) ) {
    1907                     $cat_query = reset( $cat_query );
    1908                     $cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' );
    1909                     if ( $cat ) {
    1910                         $this->set('cat', $cat->term_id);
    1911                         $this->set('category_name', $cat->slug);
    1912                     }
     1904            $cat_query = wp_list_filter( $q['tax_query'], array( 'taxonomy' => 'category' ) );
     1905            if ( !empty( $cat_query ) ) {
     1906                $cat_query = reset( $cat_query );
     1907                $cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' );
     1908                if ( $cat ) {
     1909                    $this->set( 'cat', $cat->term_id );
     1910                    $this->set( 'category_name', $cat->slug );
    19131911                }
    19141912            }
    1915 
    1916             unset( $ids );
    19171913        }
    19181914
Note: See TracChangeset for help on using the changeset viewer.