Avoid notice when themes dir is empty or missing. Don't reset current theme in current_theme_info() if there are no themes. Show warning in Right Now if there are no themes. Props azaozz. fixes #19089

git-svn-id: https://develop.svn.wordpress.org/trunk@19251 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2011-11-11 14:10:54 +00:00
parent 26ed0186e0
commit d154749f87
3 changed files with 18 additions and 5 deletions
+5 -4
View File
@@ -518,12 +518,13 @@ function get_current_theme() {
return $theme;
$themes = get_themes();
$theme_names = array_keys($themes);
$current_template = get_option('template');
$current_stylesheet = get_option('stylesheet');
$current_theme = 'Twenty Ten';
$current_theme = 'Twenty Eleven';
if ( $themes ) {
$theme_names = array_keys( $themes );
$current_template = get_option( 'template' );
$current_stylesheet = get_option( 'stylesheet' );
foreach ( (array) $theme_names as $theme_name ) {
if ( $themes[$theme_name]['Stylesheet'] == $current_stylesheet &&
$themes[$theme_name]['Template'] == $current_template ) {