From 4553f8cef0d9b827ec840a720e7853456e68492e Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 30 Dec 2004 21:58:01 +0000 Subject: [PATCH] Use load_template(). git-svn-id: https://develop.svn.wordpress.org/trunk@2023 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 2 +- wp-includes/template-functions-general.php | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 42735a7fe6..b31b94c38f 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1649,7 +1649,7 @@ function load_template($file) { extract($wp_query->query_vars); - include($file); + require_once($file); } function add_magic_quotes($array) { diff --git a/wp-includes/template-functions-general.php b/wp-includes/template-functions-general.php index bc5884d7f2..8cfa756dc2 100644 --- a/wp-includes/template-functions-general.php +++ b/wp-includes/template-functions-general.php @@ -3,27 +3,24 @@ /* Note: these tags go anywhere in the template */ function get_header() { - global $wpdb, $wp_query; if ( file_exists( TEMPLATEPATH . '/header.php') ) - require_once( TEMPLATEPATH . '/header.php'); + load_template( TEMPLATEPATH . '/header.php'); else - require_once( ABSPATH . 'wp-includes/wp-header.php'); + load_template( ABSPATH . 'wp-includes/wp-header.php'); } function get_footer() { - global $wpdb, $wp_query; if ( file_exists( TEMPLATEPATH . '/footer.php') ) - require_once( TEMPLATEPATH . '/footer.php'); + load_template( TEMPLATEPATH . '/footer.php'); else - require_once( ABSPATH . 'wp-includes/wp-footer.php'); + load_template( ABSPATH . 'wp-includes/wp-footer.php'); } function get_sidebar() { - global $wpdb, $wp_query; if ( file_exists( TEMPLATEPATH . '/sidebar.php') ) - require_once( TEMPLATEPATH . '/sidebar.php'); + load_template( TEMPLATEPATH . '/sidebar.php'); else - require_once( ABSPATH . 'wp-includes/wp-sidebar.php'); + load_template( ABSPATH . 'wp-includes/wp-sidebar.php'); }