Tweak theme validation.

git-svn-id: https://develop.svn.wordpress.org/trunk@4017 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-07-11 22:44:56 +00:00
parent 81c4396c21
commit e69d028988
3 changed files with 19 additions and 29 deletions

View File

@@ -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'));
}
@@ -374,4 +369,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;
}
?>