[wp-trac] [WordPress Trac] #56721: get_page_by_title: duplicate SQL query

WordPress Trac noreply at wordpress.org
Tue Oct 4 03:31:20 UTC 2022


#56721: get_page_by_title: duplicate SQL query
-------------------------------+----------------------------
 Reporter:  david.binda        |       Owner:  peterwilsoncc
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:  6.1
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:  fixed
 Keywords:  has-patch commit   |     Focuses:  performance
-------------------------------+----------------------------
Changes (by peterwilsoncc):

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


Comment:

 In [changeset:"54377" 54377]:
 {{{
 #!CommitTicketReference repository="" revision="54377"
 Posts, Post types: Prevent `get_page_by_title()` parsing query twice.

 In `get_page_by_title()` access the populated `WP_Query::posts` property
 directly rather than via the `WP_Query::get_posts()` method. This removes
 unnecessary reprocessing of the query.

 Follow up to [54234].

 Props david.binda, mukesh27, spacedmonkey.
 Fixes #56721.
 }}}

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


More information about the wp-trac mailing list