[wp-trac] [WordPress Trac] #18265: Use load_template in template-loader.php

WordPress Trac wp-trac at lists.automattic.com
Wed Jul 27 13:01:33 UTC 2011


#18265: Use load_template in template-loader.php
-------------------------+----------------------
 Reporter:  elyobo       |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  Template     |     Version:
 Severity:  normal       |  Resolution:  wontfix
 Keywords:  has-patch    |
-------------------------+----------------------

Comment (by scribu):

 > You could also extract your variables into the global namespace on the
 template_redirect or template_include hooks.

 That wouldn't work, since you would be in the callback's scope, not in
 load_template()'s.

 Even if load_template() did accept a $data arg, it would still be akward
 to use, since it's called by WP Core.

 But with the 'template_include' filter you can do pretty much whatever you
 want: check {{{basename( $template )}}}, use conditional tags like
 is_single(), use your own version of load_template() etc.

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


More information about the wp-trac mailing list