Support » Plugin: User Role Editor » Hide Additional Capabilities

  • I have created a user role which I want to be able to edit users. I achieved this by enabling the “edit_users” capability in the user role editor plugin.

    However, for that same user role, I want to hide the “Additional Capabilities” area when someone of that user role goes to edit a user in the “users” tab in the backend of wordpress.

    Is this possible? If so, what capability in the user role editor plugin do I have to enable/disable?

    Thanks for your time.

Viewing 1 replies (of 1 total)
  • Plugin Author Vladimir Garagulia

    (@shinephp)

    Apply this code via active theme functions.php file or Must Use plugin. Just change ‘user-manager’ role to your own one:

    
    add_filter('ure_show_additional_capabilities_section', 'ure_show_additional_capabilities_section');
    add_filter('ure_bulk_grant_roles',  'ure_show_additional_capabilities_section');
    
     
    function ure_show_additional_capabilities_section($show) {
    
        $user = wp_get_current_user();
        if (in_array('user-manager', $user->roles)) {
            $show = false;
        }
    
        return $show;
    }
    
    add_filter('ure_users_select_primary_role', 'ure_users_select_primary_role', 10, 1);
    function ure_users_select_primary_role($select) {
    
        $user = wp_get_current_user();
        if (in_array('user-manager', $user->roles)) {
            $select = false;
        }
        
        return $select;
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Hide Additional Capabilities’ is closed to new replies.