[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 18:47:39 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:  wontfix =>


Comment:

 @nacin:

 As you've noted with {$type}_template: some of the filter names are
 generated on the fly. There's no way for us to know what all the possible
 filter names are, so we can't hook into every *_template filter that might
 be called. So that doesn't work for us.

 The filter we've added with this patch doesn't need any additional
 context. It's simply a filter on the path to a template that executes
 before the template is included.

 @Denis:

 I'm afraid that doesn't work either. template_redirect isn't called when
 templates are included using load_template() in wp-include/theme.php.

 We really have thought about this!

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


More information about the wp-trac mailing list