Make WordPress Core

Changeset 15888


Ignore:
Timestamp:
10/21/2010 02:06:52 PM (16 years ago)
Author:
scribu
Message:

Revert accidental changes to WP_Query made in [15887]. See #14163

File:
1 edited

Legend:

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

    r15887 r15888  
    11861186                        , 's'
    11871187                        , 'sentence'
    1188                         , 'fields'
    11891188                );
    11901189
    11911190                foreach ( $keys as $key ) {
    1192                         if ( !isset($array[$key]) )
     1191                        if ( !isset($array[$key]))
    11931192                                $array[$key] = '';
    11941193                }
    … …  
    11981197
    11991198                foreach ( $array_keys as $key ) {
    1200                         if ( !isset($array[$key]) )
     1199                        if ( !isset($array[$key]))
    12011200                                $array[$key] = array();
    12021201                }
    … …  
    16501649                $search = '';
    16511650                $groupby = '';
    1652                 $fields = '';
     1651                $fields = "$wpdb->posts.*";
    16531652                $post_status_join = false;
    16541653                $page = 1;
    … …  
    17301729                else
    17311730                        $q['no_found_rows'] = false;
    1732 
    1733                 switch ( $q['fields'] ) {
    1734                         case 'ids':
    1735                                 $fields = "$wpdb->posts.ID";
    1736                                 break;
    1737                         case 'id=>parent':
    1738                                 $fields = "$wpdb->posts.ID, $wpdb->posts.post_parent";
    1739                                 break;
    1740                         default:
    1741                                 $fields = "$wpdb->posts.*";
    1742                 }
    17431731
    17441732                // If a month is specified in the querystring, load that month
    … …  
    22852273                if ( !empty( $orderby ) )
    22862274                        $orderby = 'ORDER BY ' . $orderby;
    2287 
    22882275                $found_rows = '';
    22892276                if ( !$q['no_found_rows'] && !empty($limits) )
    … …  
    22942281                        $this->request = apply_filters_ref_array('posts_request', array( $this->request, &$this ) );
    22952282
    2296                 if ( 'ids' == $q['fields'] ) {
    2297                         $this->posts = $wpdb->get_col($this->request);
    2298 
    2299                         return $this->posts;
    2300                 }
    2301 
    2302                 if ( 'id=>parent' == $q['fields'] ) {
    2303                         $this->posts = $wpdb->get_results($this->request);
    2304 
    2305                         $r = array();
    2306                         foreach ( $this->posts as $post )
    2307                                 $r[ $post->ID ] = $post->post_parent;
    2308 
    2309                         return $r;
    2310                 }
    2311 
    23122283                $this->posts = $wpdb->get_results($this->request);
    2313 
    23142284                // Raw results filter.  Prior to status checks.
    23152285                if ( !$q['suppress_filters'] )
Note: See TracChangeset for help on using the changeset viewer.