From c369310b0cace2f27ab177e6b81bd948710609e7 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 29 Aug 2005 23:40:32 +0000 Subject: [PATCH] Better support for theme plugins. add_theme_page() and active theme functions.php autoloader. git-svn-id: http://svn.automattic.com/wordpress/trunk@2818 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 7 ++++++- wp-settings.php | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index d52a62eca..2e58cbe5d 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -1144,6 +1144,11 @@ function add_management_page($page_title, $menu_title, $access_level, $file, $fu return add_submenu_page('edit.php', $page_title, $menu_title, $access_level, $file, $function); } +function add_theme_page($page_title, $menu_title, $access_level, $file, $function = '') { + return add_submenu_page('themes.php', $page_title, $menu_title, $access_level, $file, $function); +} + + function validate_file($file, $allowed_files = '') { if ( false !== strpos($file, './')) return 1; @@ -1393,4 +1398,4 @@ function get_importers() { return $wp_importers; } -?> \ No newline at end of file +?> diff --git a/wp-settings.php b/wp-settings.php index 6422bf329..df1f3d918 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -189,6 +189,10 @@ load_default_textdomain(); // Pull in locale data after loading text domain. require_once(ABSPATH . WPINC . '/locale.php'); +// Load functions for active theme. +if ( file_exists(TEMPLATEPATH . "/functions.php") ) + include(TEMPLATEPATH . "/functions.php"); + function shutdown_action_hook() { do_action('shutdown'); }