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

WordPress Trac noreply at wordpress.org
Wed Jun 8 11:53:10 UTC 2016


#36905: Add caching to get_page_by_title
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:  igmoweb
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
Component:  Posts, Post Types                    |  Release
 Severity:  normal                               |     Version:  2.1
 Keywords:  has-patch good-first-bug has-unit-   |  Resolution:
  tests                                          |     Focuses:
                                                 |  performance
-------------------------------------------------+-------------------------

Comment (by igmoweb):

 36905.5.patch includes some improvements to the function:

 - orderby is set to 'none' so it preserves the same order than the
 original function
 - post_status is now an array with 'any' + all existent statuses even
 those that are excluded from search. This way, the query has less
 conditionals in WHERE clause and post_status field is not even filtered,
 like the original function.
 - I added tests to check that the function query every single post status.

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


More information about the wp-trac mailing list