WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/12/2018 04:42:11 PM (4 years ago)
Author:
flixos90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/capabilities.php

    r42809 r42832  
    549549            }
    550550            break;
     551        case 'upgrade_php':
     552            if ( is_multisite() && ! is_super_admin( $user_id ) ) {
     553                $caps[] = 'do_not_allow';
     554            } else {
     555                $caps[] = 'update_core';
     556            }
     557            break;
    551558        default:
    552559            // Handle meta capabilities for custom post types.
Note: See TracChangeset for help on using the changeset viewer.