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

WordPress Trac noreply at wordpress.org
Sat Mar 15 10:08:10 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:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+----------------------------

Comment (by SirLouen):

 Replying to [comment:46 peterwilsoncc]:
 > Honestly, the second part was playing around with micro-optimisations to
 see if comparing a string would be faster than type checking.

 Ok, now I see at this point that you were trying to micro-optimize the
 `all` field in exchange for the other variants.

 Yesterday I was thinking: If this has been like this for a good time, as I
 said, performance impact could occur on those who were not needed to fully
 hydrate the global post as I showed in my example.

 As @joemcgill pointed out, I completely overlooked the fact that "by
 default" the global post is always expected to be hydrated.

 But here is the catch: what if we introduced a new parameter in
 `the_post`, that permits overriding this whole behavior on demand? This
 could return the performance impact for those who wanted to keep it as-is
 and keep it compliant with my examples.

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


More information about the wp-trac mailing list