[wp-trac] [WordPress Trac] #11242: Add "template_include" action to be run just before templates are included
WordPress Trac
wp-trac at lists.automattic.com
Tue Nov 24 17:09:22 UTC 2009
#11242: Add "template_include" action to be run just before templates are included
-----------------------------+----------------------------------------------
Reporter: holizz | Owner: westi
Type: enhancement | Status: reopened
Priority: normal | Milestone:
Component: Plugins | Version:
Severity: normal | Resolution:
Keywords: has-patch close |
-----------------------------+----------------------------------------------
Changes (by harrym):
* status: closed => reopened
* resolution: worksforme =>
Comment:
Well, I can answer those!
template_redirect is a hook, not a filter, so it doesn't give you access
to the template path that's been chosen or give you a chance to change it.
It's called before wordpress even decides what template to load.
There are *_template filters, but it's not possible to enumerate a
complete set of them and hook them all: the attachment filter, for
example, generates the filter tag by looking at the MIME type of the
attachment. Since plugins can add whatever mime types they like, it's not
possible to generate a complete set of *_template filters to hook into.
The Carrington template appears to use the is_* functions to figure out
what template it's in -- which is fine. We're not trying to do that. We're
trying to change the default template loader's behaviour, so executing
code after the template has already been chosen and included won't work.
What's the harm in adding this as a new filter?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11242#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list