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

WordPress Trac noreply at wordpress.org
Fri Apr 5 20:16:37 UTC 2013


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

Comment (by meloniq):

 @coffee2code, sorry, just noticed that my patch is duplicate of patch
 submitted by @wpmuguru - I could leave just an comment... As I said in my
 previous comment, I like more the idea with 'template stacks' ( see #22355
 ) where You can simply register new template location with priority, so
 plugins like WPEC, WC or BP could register template location with lower
 priority, and included template will be loaded from this location only if
 theme or child theme does not have it...

 Suggested filter after the parent/child checks seems to be safe, does not
 require extra testing (3.6 is close), and gives full control over this
 what happening in {{{locate_template()}}}... so before we will find
 perfect solution to get out from this limited hierarchy (child->parent),
 with which everyone would agree that is the way to go - this filter would
 allow for it (load templates from other locations).

 Note: {{{file_exists()}}} doesn't seems to be an expensive function, and
 it have cache: http://php.net/manual/en/function.file-exists.php

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


More information about the wp-trac mailing list