Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_maybe_grant_site_health_caps ›

Od5.2.2
Przestarzałyn/a
wp_maybe_grant_site_health_caps ( $allcaps, $caps, $args, $user )
Parametry: (4)
  • (bool[]) $allcaps An array of all the user's capabilities.
    Wymagane: Tak
  • (string[]) $caps Required primitive capabilities for the requested capability.
    Wymagane: Tak
  • (array) $args { Arguments that accompany the requested capability check.
    Wymagane: Tak
  • (WP_User) $user The user object.
    Wymagane: Tak
Powrót:
  • (bool[]) Filtered array of the user's capabilities.
Zdefiniowane na:
Codex:

Filters the user capabilities to grant the 'view_site_health_checks' capabilities as necessary.



Źródło

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;
}