From 4336a2b9a7491e2accaf7dca17c0895ff99861e9 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 27 Jul 2020 15:04:03 +0000 Subject: [PATCH] Themes: Display a message in theme grid if a theme requires a higher version of PHP or WordPress. This applies to the Themes screen, Add Themes screen, and the Customizer theme browser. Props afragen, desrosj, SergeyBiryukov. See #48491. Built from https://develop.svn.wordpress.org/trunk@48638 git-svn-id: http://core.svn.wordpress.org/trunk@48400 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/theme-install.php | 64 +++++++++++++++++-- wp-admin/themes.php | 55 ++++++++++++++++ .../class-wp-customize-theme-control.php | 55 ++++++++++++++++ wp-includes/version.php | 2 +- 4 files changed, 171 insertions(+), 5 deletions(-) diff --git a/wp-admin/theme-install.php b/wp-admin/theme-install.php index 2fbdc4ef64..8f9d3c6137 100644 --- a/wp-admin/theme-install.php +++ b/wp-admin/theme-install.php @@ -271,6 +271,66 @@ if ( $tab ) { <# } else { #>
<# } #> + + <# if ( data.installed ) { #> +

+ <# } #> + + <# if ( ! data.compatible_wp || ! data.compatible_php ) { #> +

+ <# if ( ! data.compatible_wp && ! data.compatible_php ) { #> + Please update WordPress, and then learn more about updating PHP.' ), + self_admin_url( 'update-core.php' ), + esc_url( wp_get_update_php_url() ) + ); + wp_update_php_annotation( '

', '' ); + } elseif ( current_user_can( 'update_core' ) ) { + printf( + /* translators: %s: URL to WordPress Updates screen. */ + ' ' . __( 'Please update WordPress.' ), + self_admin_url( 'update-core.php' ) + ); + } elseif ( current_user_can( 'update_php' ) ) { + printf( + /* translators: %s: URL to Update PHP page. */ + ' ' . __( 'Learn more about updating PHP.' ), + esc_url( wp_get_update_php_url() ) + ); + wp_update_php_annotation( '

', '' ); + } + ?> + <# } else if ( ! data.compatible_wp ) { #> + Please update WordPress.' ), + self_admin_url( 'update-core.php' ) + ); + } + ?> + <# } else if ( ! data.compatible_php ) { #> + Learn more about updating PHP.' ), + esc_url( wp_get_update_php_url() ) + ); + wp_update_php_annotation( '

', '' ); + } + ?> + <# } #> +

+ <# } #> +
- - <# if ( data.installed ) { #> -

- <# } #>