From 332ce58d5c51334d1e1ad467398c05e794eb6ce0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 27 Jul 2020 14:24:19 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@48637 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/theme-install.php | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index 3746d0040e..2fbdc4ef64 100644 --- a/src/wp-admin/theme-install.php +++ b/src/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 }}}