Filters the user capabilities to grant the ‘view_site_health_checks’ capabilities as necessary.
Parameters
$allcaps
bool[]required- An array of all the user’s capabilities.
$caps
string[]required- Required primitive capabilities for the requested capability.
$args
arrayrequired- Arguments that accompany the requested capability check.
0
stringRequested capability.1
intConcerned user ID....$2
mixedOptional second and further parameters, typically object ID.
$user
WP_Userrequired- The user object.
Source
function wp_maybe_grant_site_health_caps( $allcaps, $caps, $args, $user ) {
if ( ! empty( $allcaps['install_plugins'] ) && ( ! is_multisite() || is_super_admin( $user->ID ) ) ) {
$allcaps['view_site_health_checks'] = true;
}
return $allcaps;
}
Changelog
Version | Description |
---|---|
5.2.2 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.