最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

users - Fix 'Add Role' Option not there in wordpress 5.2.2

programmeradmin0浏览0评论

I am making my website on the net and practicing it on localhost wordpress. I want to add a new role in my wordpress, but in both my sites(localhost and internet) I can't find the option to add a role. I went to google for this problem but I didn't found an answer. I am using an custom theme based on 'Twenty Nineteen' if it helps.

I am making my website on the net and practicing it on localhost wordpress. I want to add a new role in my wordpress, but in both my sites(localhost and internet) I can't find the option to add a role. I went to google for this problem but I didn't found an answer. I am using an custom theme based on 'Twenty Nineteen' if it helps.

Share Improve this question asked Aug 25, 2019 at 16:47 MinleyMinley 101
Add a comment  | 

1 Answer 1

Reset to default 1

"Add Role" isn't an option in WordPress, and never has been. If you want to add a role you'll need a plugin like User Role Editor or Members.

If you want to add a role with code, you can do this with the add_role() function:

add_role(
    'member', 
    'Member', 
    [
        'edit_posts' => true,
    ]
);

Just be aware that roles are persistent, so this function should only be run once on theme/plugin activation.

发布评论

评论列表(0)

  1. 暂无评论