WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/10/2019 07:41:12 AM (2 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.
Fixes #46957.

File:
1 edited

Legend:

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

    r44973 r45507  
    581581add_filter( 'user_has_cap', 'wp_maybe_grant_install_languages_cap', 1 );
    582582add_filter( 'user_has_cap', 'wp_maybe_grant_resume_extensions_caps', 1 );
     583add_filter( 'user_has_cap', 'wp_maybe_grant_site_health_caps', 1, 4 );
    583584
    584585unset( $filter, $action );
Note: See TracChangeset for help on using the changeset viewer.