From cff4c42d360397eac62c59470c675f1014c2e57e Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 6 Jan 2006 01:09:16 +0000 Subject: [PATCH] Avoid invoking template filters twice. Props David House. fixes #2225 git-svn-id: http://svn.automattic.com/wordpress/trunk@3409 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-loader.php | 50 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/wp-includes/template-loader.php b/wp-includes/template-loader.php index f503f37e4e..ac69dab08c 100644 --- a/wp-includes/template-loader.php +++ b/wp-includes/template-loader.php @@ -7,45 +7,45 @@ if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) { } else if ( is_trackback() ) { include(ABSPATH . '/wp-trackback.php'); exit; - } else if ( is_404() && get_404_template() ) { - include(get_404_template()); + } else if ( is_404() && $template = get_404_template() ) { + include($template); exit; - } else if ( is_search() && get_search_template() ) { - include(get_search_template()); + } else if ( is_search() && $template = get_search_template() ) { + include($template); exit; - } else if ( is_home() && get_home_template() ) { - include(get_home_template()); + } else if ( is_home() && $template = get_home_template() ) { + include($template); exit; - } else if ( is_attachment() && get_attachment_template() ) { - include(get_attachment_template()); + } else if ( is_attachment() && $template = get_attachment_template() ) { + include($template); exit; - } else if ( is_single() && get_single_template() ) { + } else if ( is_single() && $template = get_single_template() ) { if ( is_attachment() ) add_filter('the_content', 'prepend_attachment'); - include(get_single_template()); + include($template); exit; - } else if ( is_page() && get_page_template() ) { + } else if ( is_page() && $template = get_page_template() ) { if ( is_attachment() ) add_filter('the_content', 'prepend_attachment'); - include(get_page_template()); + include($template); exit; - } else if ( is_category() && get_category_template()) { - include(get_category_template()); + } else if ( is_category() && $template = get_category_template()) { + include($template); exit; - } else if ( is_author() && get_author_template() ) { - include(get_author_template()); + } else if ( is_author() && $template = get_author_template() ) { + include($template); exit; - } else if ( is_date() && get_date_template() ) { - include(get_date_template()); + } else if ( is_date() && $template = get_date_template() ) { + include($template); exit; - } else if ( is_archive() && get_archive_template() ) { - include(get_archive_template()); + } else if ( is_archive() && $template = get_archive_template() ) { + include($template); exit; - } else if ( is_comments_popup() && get_comments_popup_template() ) { - include(get_comments_popup_template()); + } else if ( is_comments_popup() && $template = get_comments_popup_template() ) { + include($template); exit; - } else if ( is_paged() && get_paged_template() ) { - include(get_paged_template()); + } else if ( is_paged() && $template = get_paged_template() ) { + include($template); exit; } else if ( file_exists(TEMPLATEPATH . "/index.php") ) { if ( is_attachment() ) @@ -64,4 +64,4 @@ if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) { } } -?> +?> \ No newline at end of file