[wp-trac] [WordPress Trac] #56992: The Loop displays incorrect data for queries started with `fields => 'id=>parent'`.

WordPress Trac noreply at wordpress.org
Tue Dec 10 12:50:00 UTC 2024


#56992: The Loop displays incorrect data for queries started with `fields =>
'id=>parent'`.
--------------------------------------+------------------------------
 Reporter:  peterwilsoncc             |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Query                     |     Version:  3.1
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------

Comment (by juzar):

 @peterwilsoncc, Yes the global post object set is wrong if used
 `ids=>parent` for fields, it creates an empty WP_Post object and assigns
 that to the global post.

 I have fixed the issue in this PR: https://github.com/WordPress/wordpress-
 develop/pull/7985

 with unit test added as above.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56992#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list