[wp-trac] [WordPress Trac] #56992: The Loop displays incorrect data for queries started with `fields => 'id=>parent'`.
WordPress Trac
noreply at wordpress.org
Tue Mar 4 23:37:32 UTC 2025
#56992: The Loop displays incorrect data for queries started with `fields =>
'id=>parent'`.
-------------------------------------------------+-------------------------
Reporter: peterwilsoncc | Owner:
| peterwilsoncc
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 6.8
Component: Query | Version: 3.1
Severity: normal | Resolution:
Keywords: 2nd-opinion has-patch has-unit- | Focuses:
tests |
-------------------------------------------------+-------------------------
Comment (by peterwilsoncc):
I've created a [https://github.com/WordPress/wordpress-develop/pull/8460
follow up pull request] to fix the issue with previews:
* adds tests for previewing both draft and published posts with autosaves
* modifies `WP_Query::the_post()` to use `WP_Query::$posts` in their
original, filtered, filtered form if the full post objects were queried
* continues to populate the post object in full for partial field queries,
parent/child relationships of IDs.
The failing tests can be seen in the [https://github.com/WordPress
/wordpress-
develop/pull/8460/commits/dfe209889c8be4e5a9b6cfc9b6f97bacf78b74e5 action
runs against the first commit].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56992#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list