如何在wordpress中为用户分配多个角色? [英] how to Assign Multiple Roles for a user in wordpress?
本文介绍了如何在wordpress中为用户分配多个角色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道如何为用户分配一个角色.但是为用户提供多个角色是行不通的...wordpress 是否提供此功能.提前致谢.
I know how to assign a single role for a user. But coming to the multiple roles for a user is not working...Is wordpress gives this facility or not.Thanks in advance.
推荐答案
为了完整性,这是可能的!
For completeness, this is possible!
$theUser = new WP_User($userId);
$theUser->add_role( $role );
这篇关于如何在wordpress中为用户分配多个角色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文