From 5f0a8d8186f3b98fbc2b2f9779b64edd058513a8 Mon Sep 17 00:00:00 2001 From: rboren Date: Thu, 30 Dec 2004 21:58:01 +0000 Subject: [PATCH] Use load_template(). git-svn-id: http://svn.automattic.com/wordpress/trunk@2023 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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'); }