WordPress.org

Make WordPress Core

Ticket #24441: 24441.patch

File 24441.patch, 1.3 KB (added by obenland, 5 years ago)
  • wp-content/themes/twentythirteen/inc/back-compat.php

     
    1313
    1414/**
    1515 * Prevent switching to Twenty Thirteen on old versions of WordPress. Switches
    16  * to the previously activated theme or the default theme.
     16 * to the default theme.
    1717 *
    1818 * @since Twenty Thirteen 1.0
    1919 *
    20  * @param string $theme_name The theme name.
    21  * @param WP_Theme $theme The theme object.
    2220 * @return void
    2321 */
    24 function twentythirteen_switch_theme( $theme_name, $theme ) {
    25         if ( 'twentythirteen' != $theme->get_template() )
    26                 switch_theme( $theme->get_template(), $theme->get_stylesheet() );
    27         elseif ( 'twentythirteen' != WP_DEFAULT_THEME )
    28                 switch_theme( WP_DEFAULT_THEME );
     22function twentythirteen_switch_theme() {
     23        switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME );
    2924
    3025        unset( $_GET['activated'] );
    3126        add_action( 'admin_notices', 'twentythirteen_upgrade_notice' );
    3227}
    33 add_action( 'after_switch_theme', 'twentythirteen_switch_theme', 10, 2 );
     28add_action( 'after_switch_theme', 'twentythirteen_switch_theme' );
    3429
    3530/**
    3631 * Prints an update nag after an unsuccessful attempt to switch to