[wp-trac] [WordPress Trac] #20061: Preprocess get_page_templates() and store in a global

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 17 18:01:31 UTC 2012


#20061: Preprocess get_page_templates() and store in a global
-------------------------+----------------------
 Reporter:  Master Jake  |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  General      |     Version:  3.3.1
 Severity:  normal       |  Resolution:  wontfix
 Keywords:               |
-------------------------+----------------------

Comment (by Master Jake):

 If it's so expensive to get a list of valid, registered page templates,
 perhaps it would be worthwhile to modify how WordPress actually discovers
 them (rather than grepping all the php files looking for a specific
 comment). Maybe a new function like register_page_template( $name, $path
 )?

 Regardless, the actual function call to retrieve the list would only need
 to be executed once per page load and then cached. Even though globals are
 evil, as you said scribu, that are used quite frequently already and so it
 definitely wouldn't be breaking any protocol to add one more.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20061#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list