[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
Thu Nov 10 02:21:02 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:
  fixed-major dev-reviewed                       |  performance
-------------------------------------------------+-------------------------
Changes (by peterwilsoncc):

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


Comment:

 In [changeset:"54784" 54784]:
 {{{
 #!CommitTicketReference repository="" revision="54784"
 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.
 Merges [54771] to the 6.1 branch.
 Fixes #56948.
 }}}

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


More information about the wp-trac mailing list