Ticket #24441: 24441.3.patch
File 24441.3.patch, 2.4 KB (added by , 8 years ago) |
---|
-
wp-content/themes/twentythirteen/inc/back-compat.php
13 13 14 14 /** 15 15 * Prevent switching to Twenty Thirteen on old versions of WordPress. Switches 16 * to the previously activated theme or thedefault theme.16 * to the default theme. 17 17 * 18 18 * @since Twenty Thirteen 1.0 19 19 * 20 * @param string $theme_name The theme name.21 * @param WP_Theme $theme The theme object.22 20 * @return void 23 21 */ 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 22 function twentythirteen_switch_theme() { 23 switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME ); 30 24 unset( $_GET['activated'] ); 31 25 add_action( 'admin_notices', 'twentythirteen_upgrade_notice' ); 32 26 } 33 add_action( 'after_switch_theme', 'twentythirteen_switch_theme' , 10, 2);27 add_action( 'after_switch_theme', 'twentythirteen_switch_theme' ); 34 28 35 29 /** 36 30 * Prints an update nag after an unsuccessful attempt to switch to … … 53 47 * @return void 54 48 */ 55 49 function 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 ) ); 57 53 } 58 54 add_action( 'load-customize.php', 'twentythirteen_customize' ); 55 56 /** 57 * Prevents the Theme Preview from being loaded on WordPress versions prior to 3.4. 58 * 59 * @since Twenty Thirteen 1.0 60 * 61 * @return void 62 */ 63 function twentythirteen_preview() { 64 if ( isset( $_GET['preview'] ) ) { 65 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'] ) ); 66 } 67 } 68 add_action( 'template_redirect', 'twentythirteen_preview' ); 69 No newline at end of file