[wp-trac] [WordPress Trac] #16128: WordPress Template System Override

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 6 22:17:27 UTC 2011


#16128: WordPress Template System Override
-----------------------------------------+-----------------------------
 Reporter:  pearsonified                 |       Owner:
     Type:  feature request              |      Status:  new
 Priority:  normal                       |   Milestone:  Future Release
Component:  Themes                       |     Version:  3.1
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch 2nd-opinion close  |
-----------------------------------------+-----------------------------

Comment (by pearsonified):

 Replying to [comment:10 pearsonified]:
 > Replying to [comment:9 duck_]:
 > > Replying to [comment:8 pearsonified]:
 > > > Nacin, the problem with not changing anything is that you cannot
 prevent the rest of the template-loader.php file from running, as Nathan
 mentioned in his response to duck_ above.
 > > >
 > > > Any thoughts on that end of things?
 > >
 > > "include a template and die"
 > >
 > > untested:
 > > {{{
 > > add_action( 'template_redirect', 'this_is_a_silly_example' );
 > > function this_is_a_silly_example() {
 > >     if ( is_single() ) {
 > >         include( TEMPLATEPATH . '/path/to/my/template.php' );
 > >         exit;
 > >     }
 > > }
 > > }}}
 >
 > IMO, exits and breaks (except when used in switch statements) are not
 elegant, and generally speaking, you can find ways to write workable code
 without the need to force anything in this manner.

 The theme_template proposal eliminates the need to do this, which is one
 of the (many) things that I find attractive about it.

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


More information about the wp-trac mailing list