I want to know what part of code should I edit to allow the shop manager in a wordpress website to delete any users account?
Thank you in advance.
I want to know what part of code should I edit to allow the shop manager in a wordpress website to delete any users account?
Thank you in advance.
You must be logged in to post a comment.
To add
'delete_users'
capability to the Shop manager user role we useadmin_init
hook,get_role()
andadd_cap()
functions.Use this php code snippet (paste it in the
function.php
file of your active child theme or theme):if you want to allow shop manager to delete users accounts then you need to add capabilities for shop manager role. Below plugin will allow you to add specific capabilities for wordpress roles. You need to add user access to shop manager using this plugin.
https://wordpress.org/plugins/user-role-editor/screenshots/