WordPress.org

Make WordPress Core

Ticket #24441: 24441.2.patch

File 24441.2.patch, 1.9 KB (added by lancewillett, 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 );
    29 
     22function twentythirteen_switch_theme() {
     23        switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME );
    3024        unset( $_GET['activated'] );
    3125        add_action( 'admin_notices', 'twentythirteen_upgrade_notice' );
    3226}
    33 add_action( 'after_switch_theme', 'twentythirteen_switch_theme', 10, 2 );
     27add_action( 'after_switch_theme', 'twentythirteen_switch_theme' );
    3428
    3529/**
    3630 * Prints an update nag after an unsuccessful attempt to switch to
     
    5347 * @return void
    5448 */
    5549function twentythirteen_customize() {
    56         wp_die( sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), $GLOBALS['wp_version'] ) . sprintf( ' <a href="javascript:history.go(-1);">%s</a>', __( 'Go back.', 'twentythirteen' ) ) );
     50        wp_die( sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), $GLOBALS['wp_version'] ), '', array(
     51                'back_link' => true,
     52        ) );
    5753}
    5854add_action( 'load-customize.php', 'twentythirteen_customize' );