Skip to content

Commit a562b54

Browse files
committed
Use value of fields for query.
1 parent 8737e5a commit a562b54

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/wp-includes/class-wp-query.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3776,12 +3776,12 @@ public function the_post() {
37763776
$post = $this->next_post();
37773777

37783778
// Ensure a full post object is available.
3779-
if ( $post instanceof stdClass ) {
3780-
// stdClass indicates that a partial post object was queried.
3781-
$post = get_post( $post->ID );
3782-
} elseif ( is_numeric( $post ) ) {
3783-
// Numeric indicates that only post IDs were queried.
3779+
if ( 'ids' === $this->query_vars['fields'] ) {
3780+
// Post IDs queried.
37843781
$post = get_post( $post );
3782+
} elseif ( 'all' !== $this->query_vars['fields'] ) {
3783+
// Partial object (stdClass) queried.
3784+
$post = get_post( $post->ID );
37853785
}
37863786

37873787
// Set up the global post object for the loop.

0 commit comments

Comments
 (0)