[wp-trac] [WordPress Trac] #45343: $query->post is null when WP_Query `fields` parameter is present

WordPress Trac noreply at wordpress.org
Wed Aug 20 13:59:07 UTC 2025


#45343: $query->post is null when WP_Query `fields` parameter is present
--------------------------+------------------------------
 Reporter:  wujek_bogdan  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by mindctrl):

 * keywords:  dev-feedback needs-testing close =>
 * status:  new => closed
 * resolution:   => invalid


Comment:

 Hi all, as Callum mentioned above, this is now documented as expected
 behavior. Source: https://github.com/WordPress/wordpress-
 develop/blob/6d26f584fb3b9d97d5a07084aef0a707c7b42b70/src/wp-includes
 /class-wp-query.php#L127-L136

 With that in mind, I'm going to close this ticket to help clean up Trac.
 Feel free to reopen if you think the intended behavior should change.

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


More information about the wp-trac mailing list