[wp-trac] [WordPress Trac] #59224: get_pages: duplicate `WP_Query::get_posts` call

WordPress Trac noreply at wordpress.org
Tue Aug 29 22:11:37 UTC 2023


#59224: get_pages: duplicate `WP_Query::get_posts` call
-------------------------------+--------------------------
 Reporter:  david.binda        |       Owner:  joemcgill
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:  6.3.2
Component:  Posts, Post Types  |     Version:  6.3
 Severity:  normal             |  Resolution:  fixed
 Keywords:  has-patch commit   |     Focuses:  performance
-------------------------------+--------------------------
Changes (by joemcgill):

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


Comment:

 In [changeset:"56491" 56491]:
 {{{
 #!CommitTicketReference repository="" revision="56491"
 Posts, Post Types: Avoid redundant SQL query in get_pages().

 This avoids an additional query by passing the query args directly to the
 `WP_Query::query()` method, rather than to the constructor and calling
 get_posts(), following [55569].

 Props david.binda, azaozz, spacedmonkey, mukesh27, flixos90,
 SergeyBiryukov, joemcgill.
 Fixes #59224.
 }}}

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


More information about the wp-trac mailing list