diff --git a/wp-includes/query.php b/wp-includes/query.php
index 04286aa..1a03834 100644
a
|
b
|
class WP_Query { |
2039 | 2039 | $fields = "$wpdb->posts.ID, $wpdb->posts.post_parent"; |
2040 | 2040 | break; |
2041 | 2041 | default: |
2042 | | $fields = "$wpdb->posts.*"; |
| 2042 | if ( is_array( $q['fields'] ) ) { |
| 2043 | $_fields = array(); |
| 2044 | foreach ( $q['fields'] as $field ) { |
| 2045 | if ( false === strpos( $field, '.' ) ) |
| 2046 | $_fields[] = "$wpdb->posts.$field"; |
| 2047 | else |
| 2048 | $_fields[] = $field; |
| 2049 | } |
| 2050 | $fields = join( ', ', $_fields ); |
| 2051 | } else { |
| 2052 | $fields = "$wpdb->posts.*"; |
| 2053 | } |
2043 | 2054 | } |
2044 | 2055 | |
2045 | 2056 | if ( '' !== $q['menu_order'] ) |
… |
… |
class WP_Query { |
2667 | 2678 | return $r; |
2668 | 2679 | } |
2669 | 2680 | |
| 2681 | if ( is_array( $q['fields'] ) ) { |
| 2682 | $this->posts = $wpdb->get_results( $this->request ); |
| 2683 | $this->post_count = count( $this->posts ); |
| 2684 | $this->set_found_posts( $q, $limits ); |
| 2685 | |
| 2686 | return $this->posts; |
| 2687 | } |
| 2688 | |
2670 | 2689 | $split_the_query = ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits ) && $q['posts_per_page'] < 500 ); |
2671 | 2690 | $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this ); |
2672 | 2691 | |