[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
Wed Nov 25 00:19:50 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: Future Release
Component: Plugins | Version: 2.9
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+---------------------------------------
Comment(by harrym):
Replying to [comment:13 Denis-de-Bernardy]:
> Replying to [comment:12 harrym]:
> > That's true, but none of these hooks allow us to *override* the
template handling. Once get_header's been called, we can't stop the header
from being included, or modify the template's path.
>
> not so.
>
> {{{
> function my_header($name) {
> // do stuff
> die;
> }
> add_action('get_header', 'my_header');
> }}}
>
> itching to re-close, personally.
*confused*
If you die in a get_header action, you kill the script before most of the
page is even created. In our case, when get_sidebar is called, we'd want
to grab the template, compile it to HAML and have Wordpress include the
compiled HAML instead of its own template.
The rest of the page still needs to be executed, and we need to be able to
tell Wordpress not to include its template if we've included ours.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11242#comment:15>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list