Change exit's to return's in template-loader.php
|Reported by:||Otto42||Owned by:||ryan|
All the exit statements in template-loader.php cause the script to terminate at that point (after the blog has been rendered). This early termination makes it difficult to include Wordpress as a piece of a larger page, as script execution will end here instead of continuing to whatever is after it.
These exits are actually unnecessary, but they do reduce execution time (in theory). As such, changing these exits to returns will have the same effect. Execution of template-loader.php will end early (as desired) and it will continue back to blog-header.php (where template-loader.php was require_once'd from). From there it will return back to index.php and thus end execution. But the use of returns will allow other packages to include('index.php') to create the blog within their own page area, allowing a greater level of customization without having to hack the main Wordpress source.
So the request is to change all "exit;" statements to "return;" statements in template-loader.php.