diff --git a/wp-content/themes/twentyfifteen/functions.php b/wp-content/themes/twentyfifteen/functions.php index cc0d81639c..b560e83de0 100644 --- a/wp-content/themes/twentyfifteen/functions.php +++ b/wp-content/themes/twentyfifteen/functions.php @@ -34,6 +34,13 @@ if ( ! isset( $content_width ) ) { $content_width = 660; } +/** + * Twenty Fifteen only works in WordPress 4.1 or later. + */ +if ( version_compare( $GLOBALS['wp_version'], '4.1', '<' ) ) { + require get_template_directory() . '/inc/back-compat.php'; +} + if ( ! function_exists( 'twentyfifteen_setup' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. diff --git a/wp-content/themes/twentyfifteen/inc/back-compat.php b/wp-content/themes/twentyfifteen/inc/back-compat.php new file mode 100644 index 0000000000..0536c0103c --- /dev/null +++ b/wp-content/themes/twentyfifteen/inc/back-compat.php @@ -0,0 +1,63 @@ +

%s

', $message ); +} + +/** + * Prevent the Customizer from being loaded on WordPress versions prior to 4.1. + * + * @since Twenty Fifteen 1.0 + */ +function twentyfifteen_customize() { + wp_die( sprintf( __( 'Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen' ), $GLOBALS['wp_version'] ), '', array( + 'back_link' => true, + ) ); +} +add_action( 'load-customize.php', 'twentyfifteen_customize' ); + +/** + * Prevent the Theme Preview from being loaded on WordPress versions prior to 4.1. + * + * @since Twenty Fifteen 1.0 + */ +function twentyfifteen_preview() { + if ( isset( $_GET['preview'] ) ) { + wp_die( sprintf( __( 'Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen' ), $GLOBALS['wp_version'] ) ); + } +} +add_action( 'template_redirect', 'twentyfifteen_preview' ); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index 98d2966eec..1c14ea9beb 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-alpha-30098'; +$wp_version = '4.1-alpha-30099'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.