![](/img/trans.png)
[英]Add Custom User-Meta to the Users Admin page in WordPress
[英]How to show custom users in the user table wordpress admin?
我想限制wordpress自定义角色以仅查看用户列表中的特定用户。
我已经创建了自定义角色(销售)。 销售角色只能查看表中的特定角色。
您需要使用以下逻辑将功能分配给销售角色,
function add_theme_caps() {
// gets the author role
$role = get_role( 'sales' );
// This only works, because it accesses the class instance.
// would allow the author to edit others' posts for current theme only
$role->add_cap( 'list_users' );
}
add_action( 'admin_init', 'add_theme_caps');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.