wp_maybe_grant_site_health_caps
函数
wp_maybe_grant_site_health_caps ( $allcaps, $caps, $args, $user )
- 参数
-
-
(bool[])
$allcaps
An array of all the user’s capabilities.- Required: 是
-
(string[])
$caps
Required primitive capabilities for the requested capability.- Required: 是
-
(array)
$args
{ Arguments that accompany the requested capability check. @type string $0 Requested capability. @type int $1 Concerned user ID. @type mixed …$2 Optional second and further parameters, typically object ID. }- Required: 是
-
(WP_User)
$user
The user object.- Required: 是
-
(bool[])
- 返回值
-
- (bool[]) Filtered array of the user’s capabilities.
- 定义位置
-
-
wp-includes/capabilities.php
, line 1251
-
wp-includes/capabilities.php
- 引入
- 5.2.2
- 弃用
- –
Filters the user capabilities to grant the ‘view_site_health_checks’ capabilities as necessary.
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; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。