Better default behaviour for theme calling

git-svn-id: https://develop.svn.wordpress.org/trunk@2303 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2005-02-13 20:38:28 +00:00
parent 2cee4ac87f
commit a735f28792
2 changed files with 50 additions and 56 deletions

View File

@ -1,4 +1,5 @@
<?php <?php
/* Don't remove this line. */ /* Short and sweet */
define('WP_USE_THEMES', true);
require('./wp-blog-header.php'); require('./wp-blog-header.php');
?> ?>

View File

@ -189,11 +189,8 @@ endif;
$wp_template_dir = TEMPLATEPATH; $wp_template_dir = TEMPLATEPATH;
// Template redirection // Template redirection
if ($pagenow == 'index.php') { if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) {
if ( isset($wp_template_redirect) && $wp_template_redirect != true) { do_action('template_redirect');
// If $wp_template_redirect is set to false, template redirection
// should be skipped for everything except feeds and trackbacks.
$wp_template_redirect = true;
if ( is_feed() && empty($doing_rss) ) { if ( is_feed() && empty($doing_rss) ) {
include(ABSPATH . '/wp-feed.php'); include(ABSPATH . '/wp-feed.php');
exit; exit;
@ -201,9 +198,6 @@ if ($pagenow == 'index.php') {
include(ABSPATH . '/wp-trackback.php'); include(ABSPATH . '/wp-trackback.php');
exit; exit;
} }
} elseif ( !isset($wp_template_redirect) ) {
$wp_template_redirect = true;
do_action('template_redirect');
if ( is_feed() && empty($doing_rss) ) { if ( is_feed() && empty($doing_rss) ) {
include(ABSPATH . '/wp-feed.php'); include(ABSPATH . '/wp-feed.php');
exit; exit;
@ -245,7 +239,6 @@ if ($pagenow == 'index.php') {
exit; exit;
} }
} }
}
if ($pagenow != 'post.php' && $pagenow != 'edit.php') { if ($pagenow != 'post.php' && $pagenow != 'edit.php') {
if ( get_settings('gzipcompression') ) if ( get_settings('gzipcompression') )