role_has_cap

过滤钩子
apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name )
参数
  • (bool[]) $capabilities Array of key/value pairs where keys represent a capability name and boolean values represent whether the role has that capability.
    Required:
  • (string) $cap Capability name.
    Required:
  • (string) $name Role name.
    Required:
定义位置
相关勾子
clean_site_cacheclean_user_cache
相关方法
like_escapehas_taghas_excerptbefore_last_barattribute_escapeclean_post_cache
引入
2.0.0
弃用
-

role_has_cap: 这个函数确定一个用户角色是否有一个特定的权限: 该函数将用户角色和权限作为参数,并返回一个布尔值,表明该角色是否具有该权限。

过滤一个角色所具有的权限。

$capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name );

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-06 13:33:19

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: