[wp-trac] [WordPress Trac] #56948: WP_Query::the_post causes a type warning when querying for ids, not full post objects

WordPress Trac noreply at wordpress.org
Wed Nov 9 00:57:18 UTC 2022


#56948: WP_Query::the_post causes a type warning when querying for ids, not full
post objects
---------------------------------------------+----------------------------
 Reporter:  konyoldeath                      |       Owner:  peterwilsoncc
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:  6.1.1
Component:  Query                            |     Version:  6.1
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:  performance
---------------------------------------------+----------------------------
Changes (by peterwilsoncc):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"54771" 54771]:
 {{{
 #!CommitTicketReference repository="" revision="54771"
 Query: Prevent ID only queries erroring when starting the loop.

 Ensure only full post objects are passed to `update_post_author_caches()`
 when called within `WP_Query::the_post()`. This prevents an error when
 starting the Loop for Queries initiated with a subset of fields or IDs
 only.

 Props konyoldeath, dd32, lozula, TimothyBlynJacobs, spacedmonkey,
 mxbclang, peterwilsoncc.
 Fixes #56948.
 }}}

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


More information about the wp-trac mailing list