Changeset 15888
- Timestamp:
- 10/21/2010 02:06:52 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r15887 r15888 1186 1186 , 's' 1187 1187 , 'sentence' 1188 , 'fields'1189 1188 ); 1190 1189 1191 1190 foreach ( $keys as $key ) { 1192 if ( !isset($array[$key]) 1191 if ( !isset($array[$key])) 1193 1192 $array[$key] = ''; 1194 1193 } … … 1198 1197 1199 1198 foreach ( $array_keys as $key ) { 1200 if ( !isset($array[$key]) 1199 if ( !isset($array[$key])) 1201 1200 $array[$key] = array(); 1202 1201 } … … 1650 1649 $search = ''; 1651 1650 $groupby = ''; 1652 $fields = '';1651 $fields = "$wpdb->posts.*"; 1653 1652 $post_status_join = false; 1654 1653 $page = 1; … … 1730 1729 else 1731 1730 $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 }1743 1731 1744 1732 // If a month is specified in the querystring, load that month … … 2285 2273 if ( !empty( $orderby ) ) 2286 2274 $orderby = 'ORDER BY ' . $orderby; 2287 2288 2275 $found_rows = ''; 2289 2276 if ( !$q['no_found_rows'] && !empty($limits) ) … … 2294 2281 $this->request = apply_filters_ref_array('posts_request', array( $this->request, &$this ) ); 2295 2282 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 2312 2283 $this->posts = $wpdb->get_results($this->request); 2313 2314 2284 // Raw results filter. Prior to status checks. 2315 2285 if ( !$q['suppress_filters'] )
Note: See TracChangeset
for help on using the changeset viewer.