From aed608b98c1ac19c0af7a8d5941cf215de7cfbab Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 15 Jun 2021 15:24:58 +0000 Subject: [PATCH] Coding Standards: Remove a one-time `$message` variable in WordPress version requirement notices for bundled themes. This makes the formatting of these messages more consistent. Follow-up to [23816], [51154]. See #52627. Built from https://develop.svn.wordpress.org/trunk@51155 git-svn-id: http://core.svn.wordpress.org/trunk@50764 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../themes/twentyfifteen/inc/back-compat.php | 27 ++++++++++++++----- .../themes/twentyfourteen/inc/back-compat.php | 27 ++++++++++++++----- .../themes/twentynineteen/inc/back-compat.php | 20 ++++++++++---- .../twentyseventeen/inc/back-compat.php | 27 ++++++++++++++----- .../themes/twentysixteen/inc/back-compat.php | 27 ++++++++++++++----- .../themes/twentythirteen/inc/back-compat.php | 27 ++++++++++++++----- wp-includes/version.php | 2 +- 7 files changed, 116 insertions(+), 41 deletions(-) diff --git a/wp-content/themes/twentyfifteen/inc/back-compat.php b/wp-content/themes/twentyfifteen/inc/back-compat.php index c06aeb815a..6b871f5e0e 100644 --- a/wp-content/themes/twentyfifteen/inc/back-compat.php +++ b/wp-content/themes/twentyfifteen/inc/back-compat.php @@ -34,9 +34,14 @@ add_action( 'after_switch_theme', 'twentyfifteen_switch_theme' ); * @since Twenty Fifteen 1.0 */ function twentyfifteen_upgrade_notice() { - /* translators: %s: WordPress version. */ - $message = sprintf( __( 'Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen' ), $GLOBALS['wp_version'] ); - printf( '

%s

', $message ); + printf( + '

%s

', + sprintf( + /* translators: %s: WordPress version. */ + __( 'Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen' ), + $GLOBALS['wp_version'] + ) + ); } /** @@ -46,8 +51,11 @@ function twentyfifteen_upgrade_notice() { */ function twentyfifteen_customize() { wp_die( - /* translators: %s: WordPress version. */ - sprintf( __( 'Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen' ), $GLOBALS['wp_version'] ), + sprintf( + /* translators: %s: WordPress version. */ + __( '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, @@ -63,8 +71,13 @@ add_action( 'load-customize.php', 'twentyfifteen_customize' ); */ function twentyfifteen_preview() { if ( isset( $_GET['preview'] ) ) { - /* translators: %s: WordPress version. */ - 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'] ) ); + wp_die( + sprintf( + /* translators: %s: WordPress version. */ + __( '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' ); diff --git a/wp-content/themes/twentyfourteen/inc/back-compat.php b/wp-content/themes/twentyfourteen/inc/back-compat.php index c3054c2c06..a0e0b118d6 100644 --- a/wp-content/themes/twentyfourteen/inc/back-compat.php +++ b/wp-content/themes/twentyfourteen/inc/back-compat.php @@ -34,9 +34,14 @@ add_action( 'after_switch_theme', 'twentyfourteen_switch_theme' ); * @since Twenty Fourteen 1.0 */ function twentyfourteen_upgrade_notice() { - /* translators: %s: WordPress version. */ - $message = sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ); - printf( '

%s

', $message ); + printf( + '

%s

', + sprintf( + /* translators: %s: WordPress version. */ + __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), + $GLOBALS['wp_version'] + ) + ); } /** @@ -46,8 +51,11 @@ function twentyfourteen_upgrade_notice() { */ function twentyfourteen_customize() { wp_die( - /* translators: %s: WordPress version. */ - sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ), + sprintf( + /* translators: %s: WordPress version. */ + __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), + $GLOBALS['wp_version'] + ), '', array( 'back_link' => true, @@ -63,8 +71,13 @@ add_action( 'load-customize.php', 'twentyfourteen_customize' ); */ function twentyfourteen_preview() { if ( isset( $_GET['preview'] ) ) { - /* translators: %s: WordPress version. */ - wp_die( sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ) ); + wp_die( + sprintf( + /* translators: %s: WordPress version. */ + __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), + $GLOBALS['wp_version'] + ) + ); } } add_action( 'template_redirect', 'twentyfourteen_preview' ); diff --git a/wp-content/themes/twentynineteen/inc/back-compat.php b/wp-content/themes/twentynineteen/inc/back-compat.php index fd78fd128b..b773460087 100644 --- a/wp-content/themes/twentynineteen/inc/back-compat.php +++ b/wp-content/themes/twentynineteen/inc/back-compat.php @@ -36,9 +36,14 @@ add_action( 'after_switch_theme', 'twentynineteen_switch_theme' ); * @global string $wp_version WordPress version. */ function twentynineteen_upgrade_notice() { - /* translators: %s: WordPress version. */ - $message = sprintf( __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), $GLOBALS['wp_version'] ); - printf( '

%s

', $message ); + printf( + '

%s

', + sprintf( + /* translators: %s: WordPress version. */ + __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), + $GLOBALS['wp_version'] + ) + ); } /** @@ -72,8 +77,13 @@ add_action( 'load-customize.php', 'twentynineteen_customize' ); */ function twentynineteen_preview() { if ( isset( $_GET['preview'] ) ) { - /* translators: %s: WordPress version. */ - wp_die( sprintf( __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), $GLOBALS['wp_version'] ) ); + wp_die( + sprintf( + /* translators: %s: WordPress version. */ + __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), + $GLOBALS['wp_version'] + ) + ); } } add_action( 'template_redirect', 'twentynineteen_preview' ); diff --git a/wp-content/themes/twentyseventeen/inc/back-compat.php b/wp-content/themes/twentyseventeen/inc/back-compat.php index 1b8c87356e..a2c9a325c2 100644 --- a/wp-content/themes/twentyseventeen/inc/back-compat.php +++ b/wp-content/themes/twentyseventeen/inc/back-compat.php @@ -36,9 +36,14 @@ add_action( 'after_switch_theme', 'twentyseventeen_switch_theme' ); * @global string $wp_version WordPress version. */ function twentyseventeen_upgrade_notice() { - /* translators: %s: The current WordPress version. */ - $message = sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ); - printf( '

%s

', $message ); + printf( + '

%s

', + sprintf( + /* translators: %s: The current WordPress version. */ + __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), + $GLOBALS['wp_version'] + ) + ); } /** @@ -50,8 +55,11 @@ function twentyseventeen_upgrade_notice() { */ function twentyseventeen_customize() { wp_die( - /* translators: %s: The current WordPress version. */ - sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ), + sprintf( + /* translators: %s: The current WordPress version. */ + __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), + $GLOBALS['wp_version'] + ), '', array( 'back_link' => true, @@ -69,8 +77,13 @@ add_action( 'load-customize.php', 'twentyseventeen_customize' ); */ function twentyseventeen_preview() { if ( isset( $_GET['preview'] ) ) { - /* translators: %s: The current WordPress version. */ - wp_die( sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ) ); + wp_die( + sprintf( + /* translators: %s: The current WordPress version. */ + __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), + $GLOBALS['wp_version'] + ) + ); } } add_action( 'template_redirect', 'twentyseventeen_preview' ); diff --git a/wp-content/themes/twentysixteen/inc/back-compat.php b/wp-content/themes/twentysixteen/inc/back-compat.php index e8c2e3411f..bf1a8d0889 100644 --- a/wp-content/themes/twentysixteen/inc/back-compat.php +++ b/wp-content/themes/twentysixteen/inc/back-compat.php @@ -38,9 +38,14 @@ add_action( 'after_switch_theme', 'twentysixteen_switch_theme' ); * @global string $wp_version WordPress version. */ function twentysixteen_upgrade_notice() { - /* translators: %s: The current WordPress version. */ - $message = sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ); - printf( '

%s

', $message ); + printf( + '

%s

', + sprintf( + /* translators: %s: The current WordPress version. */ + __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), + $GLOBALS['wp_version'] + ) + ); } /** @@ -52,8 +57,11 @@ function twentysixteen_upgrade_notice() { */ function twentysixteen_customize() { wp_die( - /* translators: %s: The current WordPress version. */ - sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ), + sprintf( + /* translators: %s: The current WordPress version. */ + __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), + $GLOBALS['wp_version'] + ), '', array( 'back_link' => true, @@ -71,8 +79,13 @@ add_action( 'load-customize.php', 'twentysixteen_customize' ); */ function twentysixteen_preview() { if ( isset( $_GET['preview'] ) ) { - /* translators: %s: The current WordPress version. */ - wp_die( sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ) ); + wp_die( + sprintf( + /* translators: %s: The current WordPress version. */ + __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), + $GLOBALS['wp_version'] + ) + ); } } add_action( 'template_redirect', 'twentysixteen_preview' ); diff --git a/wp-content/themes/twentythirteen/inc/back-compat.php b/wp-content/themes/twentythirteen/inc/back-compat.php index c267b999d1..2f30c1c713 100644 --- a/wp-content/themes/twentythirteen/inc/back-compat.php +++ b/wp-content/themes/twentythirteen/inc/back-compat.php @@ -34,9 +34,14 @@ add_action( 'after_switch_theme', 'twentythirteen_switch_theme' ); * @since Twenty Thirteen 1.0 */ function twentythirteen_upgrade_notice() { - /* translators: %s: WordPress 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 ); + printf( + '

%s

', + sprintf( + /* translators: %s: WordPress version. */ + __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), + $GLOBALS['wp_version'] + ) + ); } /** @@ -46,8 +51,11 @@ function twentythirteen_upgrade_notice() { */ function twentythirteen_customize() { wp_die( - /* translators: %s: WordPress version. */ - 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( + /* translators: %s: WordPress version. */ + __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), + $GLOBALS['wp_version'] + ), '', array( 'back_link' => true, @@ -63,8 +71,13 @@ add_action( 'load-customize.php', 'twentythirteen_customize' ); */ function twentythirteen_preview() { if ( isset( $_GET['preview'] ) ) { - /* translators: %s: WordPress version. */ - 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'] ) ); + wp_die( + sprintf( + /* translators: %s: WordPress version. */ + __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), + $GLOBALS['wp_version'] + ) + ); } } add_action( 'template_redirect', 'twentythirteen_preview' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 556df2098b..f1902109c1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-beta1-51154'; +$wp_version = '5.8-beta1-51155'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.