Uses
Uses | Description |
---|---|
wp-includes/capabilities.php: is_super_admin() | Determine if user is a site admin. |
wp-includes/load.php: is_multisite() | If Multisite is enabled. |
Filters the user capabilities to grant the ‘view_site_health_checks’ capabilities as necessary.
(bool[]) (Required) An array of all the user's capabilities.
(string[]) (Required) Required primitive capabilities for the requested capability.
(array) (Required) Arguments that accompany the requested capability check.
(int) Concerned user ID.
(mixed) Optional second and further parameters, typically object ID.
(WP_User) (Required) The user object.
(bool[]) Filtered array of the user's capabilities.
File: wp-includes/capabilities.php
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; }
Version | Description |
---|---|
5.2.2 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_maybe_grant_site_health_caps