user_can()判断用户角色是否有某个权限

目录

描述

Whether a user has capability or role. Similar to current_user_can(), but this function takes a user ID or object as its first parameter.

user_can() 描述

用法

 <?php user_can$user$capability ); ?> 

user_can() 用法

参数

$user

(object or integer (ID)) (必填) required

默认值: None

$capability

(string) (必填) capability or role name.

默认值: None

user_can() 参数

相关