[wp-trac] [WordPress Trac] #56992: The Loop displays incorrect data for queries started with `fields => 'id=>parent'`.
WordPress Trac
noreply at wordpress.org
Sun Mar 16 22:55:26 UTC 2025
#56992: The Loop displays incorrect data for queries started with `fields =>
'id=>parent'`.
--------------------------------------+----------------------------
Reporter: peterwilsoncc | Owner: peterwilsoncc
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 6.8
Component: Query | Version: 3.1
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses: performance
--------------------------------------+----------------------------
Changes (by peterwilsoncc):
* status: reopened => closed
* resolution: => fixed
Comment:
In [changeset:"59993" 59993]:
{{{
#!CommitTicketReference repository="" revision="59993"
Query: Fix performance regression starting the loop for `all` fields.
Fixes a performance regression starting the loop after calling `WP_Query(
[ 'fields' => 'all' ] )`. This changes how `WP_Query::the_post()`
determines whether there is a need to traverse the posts for cache
warming.
If IDs are queried, `WP_Query::$posts` is assumed to be an array of post
IDs. If all fields are queried, `WP_Query::$posts` is assumed to be an
array of fully populated post objects.
Follow up to [59919], [59937].
Props joemcgill, peterwilsoncc, SirLouen.
Fixes #56992.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56992#comment:53>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list