From 7ee6aecd1bebb912b1a0e9514027880e57b7a0d6 Mon Sep 17 00:00:00 2001 From: nacin Date: Mon, 4 Oct 2010 19:50:13 +0000 Subject: [PATCH] Account for Twenty Ten in theme name collisions and properly fall back to TT in get_current_theme(). fixes #15719, props tonyf12. git-svn-id: http://svn.automattic.com/wordpress/trunk@15720 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index ada81d859..82d6f0832 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -399,10 +399,14 @@ function get_themes() { // Check for theme name collision. This occurs if a theme is copied to // a new theme directory and the theme header is not updated. Whichever // theme is first keeps the name. Subsequent themes get a suffix applied. - // The Default and Classic themes always trump their pretenders. + // The Twenty Ten, Default and Classic themes always trump their pretenders. if ( isset($wp_themes[$name]) ) { - if ( ('WordPress Default' == $name || 'WordPress Classic' == $name) && - ('default' == $stylesheet || 'classic' == $stylesheet) ) { + $trump_cards = array( + 'classic' => 'WordPress Classic', + 'default' => 'WordPress Default', + 'twentyten' => 'Twenty Ten', + ); + if ( isset( $trump_cards[ $stylesheet ] ) && $name == $trump_cards[ $stylesheet ] ) { // If another theme has claimed to be one of our default themes, move // them aside. $suffix = $wp_themes[$name]['Stylesheet']; @@ -518,7 +522,7 @@ function get_current_theme() { $theme_names = array_keys($themes); $current_template = get_option('template'); $current_stylesheet = get_option('stylesheet'); - $current_theme = 'WordPress Default'; + $current_theme = 'Twenty Ten'; if ( $themes ) { foreach ( (array) $theme_names as $theme_name ) {