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

WordPress Trac noreply at wordpress.org
Tue Jun 7 12:33:39 UTC 2016


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

Comment (by igmoweb):

 I propose to let WP_Query handle this.

 I'd also propose to deprecate this function. Is not used by Core so
 plugins could use their own functions instead. Querying by title is not a
 very good idea so we would be discouraging developers to use this function
 (maybe just a little but more than nothing). @scribu said the same in
 here: https://core.trac.wordpress.org/ticket/20350#comment:1 I don't know
 if she would think the same today.

 Anyway, here are my changes: Unit tests + changes inside the function (not
 deprecated though) so now it uses WP_Query instead.

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


More information about the wp-trac mailing list