From 2c1ee2914310cf39fa5c2eead15ff50399af56d8 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sun, 7 Feb 2010 23:19:39 +0000 Subject: [PATCH] Slightly more informative error message for themes missing their parent theme. Need to offer to install the parent if it is in the themes directory. git-svn-id: https://develop.svn.wordpress.org/trunk@13020 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index db4c8dfb7b..f79bf48406 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -297,6 +297,8 @@ function get_themes() { $title = $name; } + $parent_template = $template; + if ( empty($template) ) { if ( file_exists("$theme_root/$stylesheet/index.php") ) $template = $stylesheet; @@ -319,7 +321,10 @@ function get_themes() { if ( isset($theme_files[$template]) && file_exists( $theme_files[$template]['theme_root'] . "/$template/index.php" ) ) { $template_directory = $theme_files[$template]['theme_root'] . "/$template"; } else { - $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.')); + if ( empty( $parent_template) ) + $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.'), 'error' => 'no_template'); + else + $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => sprintf( __('The parent theme is missing. Please install the "%s" parent theme.'), $parent_template ), 'error' => 'no_parent', 'parent' => $parent_template ); continue; }