• Is there a way to disable the “Additional Capabilities” option altogether? I’m having an issue where Woocommerce subscriptions is updating my users with the default user role in the “Additional Capabilities” section, which is giving my users two user roles. I have to go in and manually remove the user role. I don’t want to just hide it, I would rather disable it completely so a second user role can’t be added. Is this possible?

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

    (@shinephp)

    Ability assign multiple user roles to a user is WordPress internal feature. URE just exposes it to WP UI. You can exclude related sections uses filters:

    /*
     * Hides Additional Capabilities section at user profile
     * and other roles section at the "Add new user" page.
     */
    
    add_filter('ure_show_additional_capabilities_section', 'ure_show_additional_capabilities_section');
    
    function ure_show_additional_capabilities_section( $show ) {
    
    /*  Remove comment if do not wish to apply this for administrators also  
        $lib = URE_Lib::get_instance();
        if ($lib->is_super_admin()) {
            return $show;
        }
    */            
        return false;
    }
    
    
    /*
     * Hides "Grant Roles" button at Users list page 
     */
    add_filter('ure_bulk_grant_roles', 'ure_bulk_grant_roles');
    
    function ure_bulk_grant_roles( $show ) {
    
    /*  Remove comment if do not wish  wish to apply this for administrators also  
        $lib = URE_Lib::get_instance();
        if ($lib->is_super_admin()) {
            return $show;
        }
    */
        
        return false;
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Disable the “Additional Capabilities” completely’ is closed to new replies.