[wp-trac] [WordPress Trac] #36905: Add caching to get_page_by_title

WordPress Trac noreply at wordpress.org
Wed Sep 21 05:27:27 UTC 2022


#36905: Add caching to get_page_by_title
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:
                                                 |  spacedmonkey
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.1
Component:  Posts, Post Types                    |     Version:  2.1
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch good-first-bug has-unit-   |     Focuses:
  tests dev-feedback commit                      |  performance
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 In [changeset:"54271" 54271]:
 {{{
 #!CommitTicketReference repository="" revision="54271"
 Posts, Post Types: Fix `WP_Query` parameter used by `get_page_by_title()`.

 Fixes the call to `WP_Query` within `get_page_by_title()` by using the
 correct title parameter, `title`.

 Modify the `orderby` parameter to prioritize the oldest published date
 over the smallest post ID. This ensures the behaviour matches that of the
 previous version of `get_page_by_title()`.

 The tests have been modified to include a populated post table to ensure
 the posts returned are matched by design rather than coincidence.

 Follow up to [54234].

 Props dd32, timothyblynjacobs, peterwilsoncc.
 Fixes #56609.
 See #36905.
 }}}

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


More information about the wp-trac mailing list