From 769f95e6e657592ae14d3635f4054c04de0a6f59 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 18 Jan 2006 19:38:29 +0000 Subject: [PATCH] Fall back to default theme if current theme is deleted. Props David House. fixes #2305 git-svn-id: https://develop.svn.wordpress.org/trunk@3459 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 64c46ac5a0..f670d189c3 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1681,6 +1681,11 @@ 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')); }