[wp-trac] [WordPress Trac] #13239: Filter locate_template template_names variable
WordPress Trac
wp-trac at lists.automattic.com
Sun Jul 10 19:48:57 UTC 2011
#13239: Filter locate_template template_names variable
---------------------------------+-----------------------------
Reporter: chrisbliss18 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Themes | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch 3.3-early |
---------------------------------+-----------------------------
Comment (by coffee2code):
Additionally, the post-template-search filter doesn't allow you to re-
prioritize template preference search order, exclude certain templates
from being located even if present, give preference to parent templates
over child templates (maybe you don't want child themes to override a
particular template), among other things.
You ''may'' be able to do some of that with the post-template-search
filter, but in many instances you'd have to perform additional (and likely
duplicate) `file_exists()` checks to determine if the already located
template should be replaced with something else under current conditions.
To address the use case you mention: A plugin could make use of the pre-
template-search filter to give preference to child and parent theme
templates over itself, allowing the plugin's template to be the last
resort if the theme doesn't otherwise provide an override.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13239#comment:20>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list