General: Introduce dashboard widget to inform administrators about outdated PHP versions.

This new dashboard widget is shown on WordPress sites which are powered by a PHP version which WordPress considers outdated, in order to inform site owners about the resulting problems and to explain how to upgrade to a supported version. An education page for that purpose has been previously created that the widget links to. The link is translatable so that localized versions of the page can be referred to as they become available.

The nag follows the example of the Browse Happy dashboard widget and is only visible for administrators, or network administrators when using multisite. To determine whether it needs to be displayed, a new wordpress.org API introduced prior is called that handles the version logic in a centralized location.

Props flixos90, hedgefield, schlessera.
Fixes #41191.

Built from https://develop.svn.wordpress.org/trunk@42832


git-svn-id: http://core.svn.wordpress.org/trunk@42662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz
2018-03-12 16:43:31 +00:00
parent d7025e7787
commit ed1df81bba
7 changed files with 133 additions and 4 deletions

View File

@@ -548,6 +548,13 @@ function map_meta_cap( $cap, $user_id ) {
$caps[] = 'manage_options';
}
break;
case 'upgrade_php':
if ( is_multisite() && ! is_super_admin( $user_id ) ) {
$caps[] = 'do_not_allow';
} else {
$caps[] = 'update_core';
}
break;
default:
// Handle meta capabilities for custom post types.
global $post_type_meta_caps;

View File

@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42830';
$wp_version = '5.0-alpha-42832';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.