From 4b2651d1e6334c319d3026b8a7bfe4ad570a3ac4 Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@13020 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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; }