![](/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.