Make WordPress Core

Ticket #22252: 22252.patch

File 22252.patch, 923 bytes (added by johnjamesjacoby, 11 years ago)

Remove $wp_theme_directories check from switch_theme()

  • wp-includes/theme.php

     
    661661 * @param string $stylesheet Stylesheet name
    662662 */
    663663function switch_theme( $stylesheet ) {
    664         global $wp_theme_directories, $sidebars_widgets;
     664        global $sidebars_widgets;
    665665
    666666        if ( is_array( $sidebars_widgets ) )
    667667                set_theme_mod( 'sidebars_widgets', array( 'time' => time(), 'data' => $sidebars_widgets ) );
     
    679679        update_option( 'template', $template );
    680680        update_option( 'stylesheet', $stylesheet );
    681681
    682         if ( count( $wp_theme_directories ) > 1 ) {
    683                 update_option( 'template_root', get_raw_theme_root( $template, true ) );
    684                 update_option( 'stylesheet_root', get_raw_theme_root( $stylesheet, true ) );
    685         }
     682        update_option( 'template_root', get_raw_theme_root( $template, true ) );
     683        update_option( 'stylesheet_root', get_raw_theme_root( $stylesheet, true ) );
    686684
    687685        $new_name  = $new_theme->get('Name');
    688686