• Resolved Tanner

    (@tannerchung)


    Is there a way to remove the “Other Roles” dropdown for specific User Roles? And is there a way to remove filter for a specific User Role in the Users page or anywhere else? For example, if I created a new user role Webmaster and did not it to appear in filters, or even the dropdown in the Users page that says “Change role to…”

    • This topic was modified 5 years, 10 months ago by Tanner.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Tanner

    (@tannerchung)

    https://www.role-editor.com/forums/topic/other-roles-addon-does-not-work-on-administrator-role/

    I just found out that this is supposed to be offered in pro. I tried the pro feature but there is a bug that’s documented in that link.

    Plugin Author Vladimir Garagulya

    (@shinephp)

    “Other Roles Access” add-on included into Pro version has another purpose while contains the same “other roles” word. I answered on your questions at the Pro version related forum that it’s not a bug, but a feature.

    In order to fulfill the task from this topic title use custom filters:

    
    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;
    }
    
    Thread Starter Tanner

    (@tannerchung)

    perfect, thank you!

    Thread Starter Tanner

    (@tannerchung)

    I’ve tried adding this code block to functions.php and it crashes the site

    Plugin Author Vladimir Garagulya

    (@shinephp)

    Error messages from the server logs will be useful in this case.
    I made another test – code works without error. You can send your own functions.php (zip it) to support [at-sign] role-editor.com. I will look what may be wrong with your version.

    Thread Starter Tanner

    (@tannerchung)

    Nevermind I got it working. For anyone who is following it’s because of some errors in my MU plugin that I created for this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove “Other Roles” drop down, roles in Users page and everywhere else?’ is closed to new replies.