diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-07-12 15:10:29 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-07-12 15:10:29 +0000 |
commit | 9b546c68fc36523578d54fec5207a10eb3fc8145 (patch) | |
tree | 75f892373ee944df9fe853ee07ee05ae07836143 /wp-includes/theme.php | |
parent | 4baf29175c471216ae4aa709fbbffc7db569d788 (diff) | |
download | wordpress-mu-9b546c68fc36523578d54fec5207a10eb3fc8145.tar.gz wordpress-mu-9b546c68fc36523578d54fec5207a10eb3fc8145.tar.xz wordpress-mu-9b546c68fc36523578d54fec5207a10eb3fc8145.zip |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@663 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/theme.php')
-rw-r--r-- | wp-includes/theme.php | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 182d148..2ce5641 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -26,11 +26,6 @@ function get_stylesheet_uri() { } function get_template() { - $template = get_settings('template'); - if (!file_exists(get_theme_root() . "/$template")) { //works for dirs too - update_option('template', 'default'); - update_option('stylesheet', 'default'); - } return apply_filters('template', get_settings('template')); } @@ -375,4 +370,22 @@ function load_template($file) { require_once($file); } +function validate_current_theme() { + if ((get_template() != 'default') && (!file_exists(get_template_directory() . '/index.php'))) { + update_option('template', 'default'); + update_option('stylesheet', 'default'); + do_action('switch_theme', 'Default'); + return false; + } + + if ((get_stylesheet() != 'default') && (!file_exists(get_template_directory() . '/style.css'))) { + update_option('template', 'default'); + update_option('stylesheet', 'default'); + do_action('switch_theme', 'Default'); + return false; + } + + return true; +} + ?> |