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
This commit is contained in:
nacin 2010-10-04 19:50:13 +00:00
parent 52c696b074
commit 7ee6aecd1b
1 changed files with 8 additions and 4 deletions

View File

@ -399,10 +399,14 @@ function get_themes() {
// Check for theme name collision. This occurs if a theme is copied to // 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 // a new theme directory and the theme header is not updated. Whichever
// theme is first keeps the name. Subsequent themes get a suffix applied. // 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 ( isset($wp_themes[$name]) ) {
if ( ('WordPress Default' == $name || 'WordPress Classic' == $name) && $trump_cards = array(
('default' == $stylesheet || 'classic' == $stylesheet) ) { '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 // If another theme has claimed to be one of our default themes, move
// them aside. // them aside.
$suffix = $wp_themes[$name]['Stylesheet']; $suffix = $wp_themes[$name]['Stylesheet'];
@ -518,7 +522,7 @@ function get_current_theme() {
$theme_names = array_keys($themes); $theme_names = array_keys($themes);
$current_template = get_option('template'); $current_template = get_option('template');
$current_stylesheet = get_option('stylesheet'); $current_stylesheet = get_option('stylesheet');
$current_theme = 'WordPress Default'; $current_theme = 'Twenty Ten';
if ( $themes ) { if ( $themes ) {
foreach ( (array) $theme_names as $theme_name ) { foreach ( (array) $theme_names as $theme_name ) {