• Resolved Rhapsody348

    (@rhapsody348)


    For all but the Administrator, I would like to hide the URE dropdowns located next to the Bulk Actions dropdown when the Users list is displayed.

    Is this possible with an options setting, or code I can include in functions.php?

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

    (@shinephp)

    Try this one:

    /*
     * Hides "Grant Roles" button, "Add Role", "Revoke Role" URE UI controls at Users list page 
     */
    add_filter('ure_bulk_grant_roles', 'ure_bulk_grant_roles');
    
    function ure_bulk_grant_roles( $show ) {
    
        $lib = URE_Lib::get_instance();
        if ($lib->is_super_admin()) {
            // do not hide for superadmin
            return $show;
        }
        
        return false;
    }
    Thread Starter Rhapsody348

    (@rhapsody348)

    Thanks Vladimir! This is almost there. The dropdown for “Change role to …” is still showing and I would like to hide that also.

    Plugin Author Vladimir Garagulya

    (@shinephp)

    “Change role to” belongs to WordPress itself. You may revoke promote_users capability. It will hide “Change role to:”, but the “Role:” field at the user profile page too.

    Thread Starter Rhapsody348

    (@rhapsody348)

    I don’t know if using css is the best approach but I modified the code you provided and have hidden the “Change to role …” and the associated “Change” button. This is the modified code.

    /*
     * Hides "Grant Roles" button, "Add Role", "Revoke Role" URE UI controls at Users list page 
     */
    add_filter('ure_bulk_grant_roles', 'ure_bulk_grant_roles');
    
    function ure_bulk_grant_roles( $show ) {
    
        $lib = URE_Lib::get_instance();
        if ($lib->is_super_admin()) {
            // do not hide for superadmin
            return $show;
        }
    
            echo '<style>
        		#new_role, #new_role2, #changeit, #changeit2 { display: none; }
        	</style>';
    
        return false;
    }
    Thread Starter Rhapsody348

    (@rhapsody348)

    Vladimir,

    Thanks for the explanation on the “Change role” belonging to WordPress. I will handle that using CSS on the user profile page too.

    I have marked this topic resolved.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hide URE Dropdowns on Users List Page’ is closed to new replies.