Change WordPress user roles and capabilities › Forums › How to or FAQ › Promote users capability › Reply To: Promote users capability
04/09/2021 at 03:42
#7678
Vladimir
Keymaster
User Role Editor by default extends WordPress UI to allow grant more than single user role via “Other Roles” field. You can hide it adding this custom code to the active theme functions.php file:
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;
}