WordPress.org

Make WordPress Core

Ticket #14470: theme-fallback-change.diff

File theme-fallback-change.diff, 1.4 KB (added by tonyf12, 8 years ago)

A patch to expand the existing checks to Twenty Ten, and have get_current_theme return Twenty Ten in that case

  • wp-includes/theme.php

     
    399399                // Check for theme name collision.  This occurs if a theme is copied to
    400400                // a new theme directory and the theme header is not updated.  Whichever
    401401                // theme is first keeps the name.  Subsequent themes get a suffix applied.
    402                 // The Default and Classic themes always trump their pretenders.
     402                // The Twenty Ten, Default and Classic themes always trump their pretenders.
    403403                if ( isset($wp_themes[$name]) ) {
    404                         if ( ('WordPress Default' == $name || 'WordPress Classic' == $name) &&
    405                                          ('default' == $stylesheet || 'classic' == $stylesheet) ) {
     404                        if ( ('WordPress Default' == $name || 'WordPress Classic' == $name || 'Twenty Ten' == $name) &&
     405                                         ('default' == $stylesheet || 'classic' == $stylesheet || 'twentyten' == $stylesheet) ) {
    406406                                // If another theme has claimed to be one of our default themes, move
    407407                                // them aside.
    408408                                $suffix = $wp_themes[$name]['Stylesheet'];
     
    518518        $theme_names = array_keys($themes);
    519519        $current_template = get_option('template');
    520520        $current_stylesheet = get_option('stylesheet');
    521         $current_theme = 'WordPress Default';
     521        $current_theme = 'Twenty Ten';
    522522
    523523        if ( $themes ) {
    524524                foreach ( (array) $theme_names as $theme_name ) {