Better default behaviour for theme calling

git-svn-id: http://svn.automattic.com/wordpress/trunk@2303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2005-02-13 20:38:28 +00:00
parent 9c4632e9f6
commit ad536c567e
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;
@ -244,7 +238,6 @@ if ($pagenow == 'index.php') {
include(TEMPLATEPATH . "/index.php"); include(TEMPLATEPATH . "/index.php");
exit; exit;
} }
}
} }
if ($pagenow != 'post.php' && $pagenow != 'edit.php') { if ($pagenow != 'post.php' && $pagenow != 'edit.php') {