From d67c469b0d841083e8b886141d01a9b0f431544f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 28 Jul 2020 11:29:28 +0000 Subject: [PATCH] Themes: Include theme name in available update messages, for better accessibility and consistency with other similar messages. Follow-up to [48652-48654]. See #48491. git-svn-id: https://develop.svn.wordpress.org/trunk@48659 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/theme.php | 18 +++++- src/wp-admin/themes.php | 58 +++++++++++++++---- .../class-wp-customize-theme-control.php | 20 +++++-- 3 files changed, 78 insertions(+), 18 deletions(-) diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php index 2fd6efe513..5f063d9102 100644 --- a/src/wp-admin/includes/theme.php +++ b/src/wp-admin/includes/theme.php @@ -811,7 +811,11 @@ function customize_themes_print_templates() {

<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #> <# } else if ( ! data.updateResponse.compatibleWP ) { #> <# } else if ( ! data.updateResponse.compatiblePHP ) { #>

-

+

', '' ); } } elseif ( ! $theme['updateResponse']['compatibleWP'] ) { - _e( 'There is a new version available, but it doesn’t work with your version of WordPress.' ); + printf( + /* translators: %s: Theme name. */ + __( 'There is a new version of %s available, but it doesn’t work with your version of WordPress.' ), + $theme['name'] + ); if ( current_user_can( 'update_core' ) ) { printf( /* translators: %s: URL to WordPress Updates screen. */ @@ -434,7 +442,11 @@ foreach ( $themes as $theme ) : ); } } elseif ( ! $theme['updateResponse']['compatiblePHP'] ) { - _e( 'There is a new version available, but it doesn’t work with your version of PHP.' ); + printf( + /* translators: %s: Theme name. */ + __( 'There is a new version of %s available, but it doesn’t work with your version of PHP.' ), + $theme['name'] + ); if ( current_user_can( 'update_php' ) ) { printf( /* translators: %s: URL to Update PHP page. */ @@ -719,10 +731,14 @@ function wp_theme_auto_update_setting_template() { <# } #>

<# } else { #> -

+

<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #> <# } else if ( ! data.updateResponse.compatibleWP ) { #> <# } else if ( ! data.updateResponse.compatiblePHP ) { #> <# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #> <# } else if ( ! data.updateResponse.compatibleWP ) { #> <# } else if ( ! data.updateResponse.compatiblePHP ) { #>

<# } else { #> -
+

<# if ( ! data.theme.updateResponse.compatibleWP && ! data.theme.updateResponse.compatiblePHP ) { #> <# } else if ( ! data.theme.updateResponse.compatibleWP ) { #> <# } else if ( ! data.theme.updateResponse.compatiblePHP ) { #>