From 39147698d9efca5492b0932c79944a4261638fe6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 27 Jul 2020 14:26:07 +0000 Subject: [PATCH] Themes: Display a message in Details & Preview modal on Add Themes screen if a theme requires a higher version of PHP or WordPress. Props afragen, desrosj, SergeyBiryukov. See #48491. Built from https://develop.svn.wordpress.org/trunk@48637 git-svn-id: http://core.svn.wordpress.org/trunk@48399 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/theme-install.php | 57 ++++++++++++++++++++++++++++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/wp-admin/theme-install.php b/wp-admin/theme-install.php index 3746d0040e..2fbdc4ef64 100644 --- a/wp-admin/theme-install.php +++ b/wp-admin/theme-install.php @@ -398,12 +398,69 @@ if ( $tab ) { <# } else { #> <# } #> +
+ + <# 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( '

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

+ <# } #> +
{{{ data.description }}}
diff --git a/wp-includes/version.php b/wp-includes/version.php index c2c6bc1269..73b6dbc302 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-beta3-48636'; +$wp_version = '5.5-beta3-48637'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.