Make WordPress Core


Ignore:
Timestamp:
06/10/2019 07:49:27 AM (5 years ago)
Author:
peterwilsoncc
Message:

Site health: Introduce view_site_health_checks capability.

Introduces the faux primitive capability view_site_health_checks available to single site admins and multisite super-admin to view the site health page within the admin.

The capability is mapped to the install_plugins capability without being dependent on the file system being writable. This fixes a bug where the feature couldn't be used by sites unable to write to the file system or managed through version control.

The capability is granted on the user_has_cap filter.

Props birgire, Clorith, palmiak, peterwilsoncc, spacedmonkey.
Merges [45507] to the 5.2 branch.
Fixes #46957 for 5.2.2.

Location:
branches/5.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • branches/5.2/src/wp-admin/menu.php

    r45142 r45508  
    264264    $submenu['tools.php'][10] = array( __( 'Import' ), 'import', 'import.php' );
    265265    $submenu['tools.php'][15] = array( __( 'Export' ), 'export', 'export.php' );
    266     $submenu['tools.php'][20] = array( __( 'Site Health' ), 'install_plugins', 'site-health.php' );
     266    $submenu['tools.php'][20] = array( __( 'Site Health' ), 'view_site_health_checks', 'site-health.php' );
    267267if ( is_multisite() && ! is_main_site() ) {
    268268    $submenu['tools.php'][25] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' );
Note: See TracChangeset for help on using the changeset viewer.