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 1011 Answer
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.