[wp-trac] [WordPress Trac] #13239: Filter locate_template template_names variable

WordPress Trac wp-trac at lists.automattic.com
Wed Dec 14 05:25:49 UTC 2011


#13239: Filter locate_template template_names variable
---------------------------------+-----------------------------
 Reporter:  chrisbliss18         |       Owner:
     Type:  enhancement          |      Status:  reopened
 Priority:  normal               |   Milestone:  Future Release
Component:  Themes               |     Version:  3.0
 Severity:  normal               |  Resolution:
 Keywords:  has-patch 3.3-early  |
---------------------------------+-----------------------------

Comment (by shawnkhall):

 The way around unnecessary hooks then is to implement only the portion
 from the c2c.2.diff above:

 {{{
 $template_name = apply_filters( "locate_template-$template_name",
 $template_name, $load, $require_once );
 }}}

 Put that right inside the template_names loop and it'll prevent
 unnecessary execution for invalid templates. This one change would address
 the problems identified by most within this thread and others (#16541).

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


More information about the wp-trac mailing list