Leave a Reply

2 comments

  1. To add 'delete_users' capability to the Shop manager user role we use admin_init hook, get_role() and add_cap() functions.

    Use this php code snippet (paste it in the function.php file of your active child theme or theme):

    function shop_manager_delete_users_cap() {
        // gets the user role
        $role = get_role( 'shop_manager' );
    
        // Add the new capability 
        $role->add_cap( 'delete_users' ); 
    }
    add_action( 'admin_init', 'shop_manager_delete_users_cap');