Changeset 15982
- Timestamp:
- 10/26/2010 07:01:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r15942 r15982 1180 1180 , 's' 1181 1181 , 'sentence' 1182 , 'fields' 1182 1183 ); 1183 1184 1184 1185 foreach ( $keys as $key ) { 1185 if ( !isset($array[$key]) )1186 if ( !isset($array[$key]) ) 1186 1187 $array[$key] = ''; 1187 1188 } … … 1191 1192 1192 1193 foreach ( $array_keys as $key ) { 1193 if ( !isset($array[$key]) )1194 if ( !isset($array[$key]) ) 1194 1195 $array[$key] = array(); 1195 1196 } … … 1641 1642 $search = ''; 1642 1643 $groupby = ''; 1643 $fields = "$wpdb->posts.*";1644 $fields = ''; 1644 1645 $post_status_join = false; 1645 1646 $page = 1; … … 1721 1722 else 1722 1723 $q['no_found_rows'] = false; 1724 1725 switch ( $q['fields'] ) { 1726 case 'ids': 1727 $fields = "$wpdb->posts.ID"; 1728 break; 1729 case 'id=>parent': 1730 $fields = "$wpdb->posts.ID, $wpdb->posts.post_parent"; 1731 break; 1732 default: 1733 $fields = "$wpdb->posts.*"; 1734 } 1723 1735 1724 1736 // If a month is specified in the querystring, load that month … … 2258 2270 if ( !empty( $orderby ) ) 2259 2271 $orderby = 'ORDER BY ' . $orderby; 2272 2260 2273 $found_rows = ''; 2261 2274 if ( !$q['no_found_rows'] && !empty($limits) ) … … 2266 2279 $this->request = apply_filters_ref_array('posts_request', array( $this->request, &$this ) ); 2267 2280 2281 if ( 'ids' == $q['fields'] ) { 2282 $this->posts = $wpdb->get_col($this->request); 2283 2284 return $this->posts; 2285 } 2286 2287 if ( 'id=>parent' == $q['fields'] ) { 2288 $this->posts = $wpdb->get_results($this->request); 2289 2290 $r = array(); 2291 foreach ( $this->posts as $post ) 2292 $r[ $post->ID ] = $post->post_parent; 2293 2294 return $r; 2295 } 2296 2268 2297 $this->posts = $wpdb->get_results($this->request); 2298 2269 2299 // Raw results filter. Prior to status checks. 2270 2300 if ( !$q['suppress_filters'] )
Note: See TracChangeset
for help on using the changeset viewer.