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.

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.

  • And what does the first and second string represent and where to put it – Demon App Programmer Aug 27 '19 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.