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

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


#16128: WordPress Template System Override
-----------------------------------------+-------------------------
 Reporter:  pearsonified                 |       Owner:
     Type:  feature request              |      Status:  closed
 Priority:  normal                       |   Milestone:
Component:  Themes                       |     Version:  3.1
 Severity:  normal                       |  Resolution:  worksforme
 Keywords:  has-patch 2nd-opinion close  |
-----------------------------------------+-------------------------
Changes (by nacin):

 * status:  new => closed
 * resolution:   => worksforme
 * milestone:  Future Release =>


Comment:

 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?

 Yep. I hinted to it in my last comment, but -- nothing else runs after
 template loader. So just `exit` or `die` when you're done to kill the
 script. Including the `die` is pretty standard whenever you need to use
 template_redirect to load a template, because whenever a plugin wants to
 override that, they'll need to stop the rest of the template hierarchy
 from firing. This is standard practice in plugins, and it really isn't
 that inelegant at all. Again, nothing else ever fires after the template
 loader -- imagine a die() at the end of the file already. You're just
 short-circuiting it.

 Make sense? I better understand the problem and use case that you and
 Nathan laid out, and I'm confident this is the exact hook you're looking
 for, so I'm closing this as worksforme.

 Cheers :-)

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


More information about the wp-trac mailing list