@billysgtr
6 years, 2 months ago
Hello,
I want to prevent a specific role user (which has some admin rights, let’s say moderator) to edit other users’ settings like changing email and password. Is there any way to do that with a hook in functions.php?
Thanks for any help!
@prashantvatsh
Yes, that is possible by removing the following capabilities from the role:
edit_users create_users delete_users
Once it is removed from the role then users from that particular role will not be able to create/edit/delete users.
Please follow this link: https://codex.wordpress.org/Function_Reference/remove_cap
Thanks
@prashantvatsh you are absolutely right. Thanks for your reply!
Awesome 🙂