Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#3790 closed enhancement (fixed)

Change exit's to return's in template-loader.php

Reported by: otto42's profile Otto42 Owned by: ryan's profile ryan
Milestone: 2.2 Priority: lowest
Severity: trivial Version: 2.1
Component: Optimization Keywords: has-patch
Focuses: Cc:


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.

Attachments (1)

3790.diff (2.4 KB) - added by Nazgul 17 years ago.

Download all attachments as: .zip

Change History (5)

#1 @Otto42
17 years ago

  • Version set to 2.1

#2 @ryan
17 years ago

  • Owner changed from anonymous to ryan

17 years ago

#3 @Nazgul
17 years ago

  • Keywords has-patch added
  • Milestone changed from 2.3 to 2.2

#4 @ryan
17 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [5104]) Return instead of exit in template-loader. Props Otto42 and Nazgul. fixes #3790

Note: See TracTickets for help on using tickets.