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

WordPress Trac noreply at wordpress.org
Tue Sep 5 20:43:58 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 fixed-major  |     Focuses:  performance
------------------------------------------+--------------------------
Changes (by flixos90):

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


Comment:

 In [changeset:"56516" 56516]:
 {{{
 #!CommitTicketReference repository="" revision="56516"
 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.
 Merges [56491] to the 6.3 branch.
 Fixes #59224.
 }}}

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


More information about the wp-trac mailing list