diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index a2a467a13b..9b191b98b6 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -596,4 +596,5 @@ require( get_template_directory() . '/inc/custom-header.php' ); /** * Adds back compat handling for WP versions pre-3.6. */ -require( get_template_directory() . '/inc/back-compat.php' ); +if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '<' ) ) + require( get_template_directory() . '/inc/back-compat.php' ); diff --git a/wp-content/themes/twentythirteen/inc/back-compat.php b/wp-content/themes/twentythirteen/inc/back-compat.php index 4a324b088e..4cc691109a 100644 --- a/wp-content/themes/twentythirteen/inc/back-compat.php +++ b/wp-content/themes/twentythirteen/inc/back-compat.php @@ -1,12 +1,26 @@ =' ) ) - return; - if ( 'twentythirteen' != $theme->template ) switch_theme( $theme->template, $theme->stylesheet ); elseif ( 'twentythirteen' != WP_DEFAULT_THEME ) @@ -17,7 +31,27 @@ function twentythirteen_switch_theme( $theme_name, $theme ) { } add_action( 'after_switch_theme', 'twentythirteen_switch_theme', 10, 2 ); +/** + * Prints an update nag after an unsuccessful attempt to switch to + * Twenty Thirteen on WordPress versions prior to 3.6. + * + * @since Twenty Thirteen 1.0 + * + * @return void + */ function twentythirteen_upgrade_notice() { - $message = sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.' ), $GLOBALS['wp_version'] ); + $message = sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), $GLOBALS['wp_version'] ); printf( '

%s

', $message ); -} \ No newline at end of file +} + +/** + * Prevents the Customizer from being loaded on WordPress versions prior to 3.6. + * + * @since Twenty Thirteen 1.0 + * + * @return void + */ +function twentythirteen_customize() { + 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( ' %s', __( 'Go back.', 'twentythirteen' ) ) ); +} +add_action( 'load-customize.php', 'twentythirteen_customize' );