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
This commit is contained in:
parent
e05ffb46a5
commit
aed608b98c
|
@ -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( '<div class="error"><p>%s</p></div>', $message );
|
||||
printf(
|
||||
'<div class="error"><p>%s</p></div>',
|
||||
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' );
|
||||
|
|
|
@ -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( '<div class="error"><p>%s</p></div>', $message );
|
||||
printf(
|
||||
'<div class="error"><p>%s</p></div>',
|
||||
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' );
|
||||
|
|
|
@ -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( '<div class="error"><p>%s</p></div>', $message );
|
||||
printf(
|
||||
'<div class="error"><p>%s</p></div>',
|
||||
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' );
|
||||
|
|
|
@ -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( '<div class="error"><p>%s</p></div>', $message );
|
||||
printf(
|
||||
'<div class="error"><p>%s</p></div>',
|
||||
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' );
|
||||
|
|
|
@ -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( '<div class="error"><p>%s</p></div>', $message );
|
||||
printf(
|
||||
'<div class="error"><p>%s</p></div>',
|
||||
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' );
|
||||
|
|
|
@ -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( '<div class="error"><p>%s</p></div>', $message );
|
||||
printf(
|
||||
'<div class="error"><p>%s</p></div>',
|
||||
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' );
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue