Revert accidental changes to WP_Query made in [15887]. See #14163
git-svn-id: https://develop.svn.wordpress.org/trunk@15888 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a3ef15ffc0
commit
8315655230
@ -1185,7 +1185,6 @@ class WP_Query extends WP_Object_Query {
|
||||
, 'preview'
|
||||
, 's'
|
||||
, 'sentence'
|
||||
, 'fields'
|
||||
);
|
||||
|
||||
foreach ( $keys as $key ) {
|
||||
@ -1649,7 +1648,7 @@ class WP_Query extends WP_Object_Query {
|
||||
$join = '';
|
||||
$search = '';
|
||||
$groupby = '';
|
||||
$fields = '';
|
||||
$fields = "$wpdb->posts.*";
|
||||
$post_status_join = false;
|
||||
$page = 1;
|
||||
|
||||
@ -1730,17 +1729,6 @@ class WP_Query extends WP_Object_Query {
|
||||
else
|
||||
$q['no_found_rows'] = false;
|
||||
|
||||
switch ( $q['fields'] ) {
|
||||
case 'ids':
|
||||
$fields = "$wpdb->posts.ID";
|
||||
break;
|
||||
case 'id=>parent':
|
||||
$fields = "$wpdb->posts.ID, $wpdb->posts.post_parent";
|
||||
break;
|
||||
default:
|
||||
$fields = "$wpdb->posts.*";
|
||||
}
|
||||
|
||||
// If a month is specified in the querystring, load that month
|
||||
if ( $q['m'] ) {
|
||||
$q['m'] = '' . preg_replace('|[^0-9]|', '', $q['m']);
|
||||
@ -2284,7 +2272,6 @@ class WP_Query extends WP_Object_Query {
|
||||
$groupby = 'GROUP BY ' . $groupby;
|
||||
if ( !empty( $orderby ) )
|
||||
$orderby = 'ORDER BY ' . $orderby;
|
||||
|
||||
$found_rows = '';
|
||||
if ( !$q['no_found_rows'] && !empty($limits) )
|
||||
$found_rows = 'SQL_CALC_FOUND_ROWS';
|
||||
@ -2293,24 +2280,7 @@ class WP_Query extends WP_Object_Query {
|
||||
if ( !$q['suppress_filters'] )
|
||||
$this->request = apply_filters_ref_array('posts_request', array( $this->request, &$this ) );
|
||||
|
||||
if ( 'ids' == $q['fields'] ) {
|
||||
$this->posts = $wpdb->get_col($this->request);
|
||||
|
||||
return $this->posts;
|
||||
}
|
||||
|
||||
if ( 'id=>parent' == $q['fields'] ) {
|
||||
$this->posts = $wpdb->get_results($this->request);
|
||||
|
||||
$r = array();
|
||||
foreach ( $this->posts as $post )
|
||||
$r[ $post->ID ] = $post->post_parent;
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
$this->posts = $wpdb->get_results($this->request);
|
||||
|
||||
// Raw results filter. Prior to status checks.
|
||||
if ( !$q['suppress_filters'] )
|
||||
$this->posts = apply_filters_ref_array('posts_results', array( $this->posts, &$this ) );
|
||||
|
Loading…
Reference in New Issue
Block a user