我认为这样的事情应该很好:
function my_views_users($args) {
$hidden_role = \'administrator\'; // it will hide filter with role \'administrator\' - you can change it to some other role
$users_counts = count_users();
$total_users = $users_counts[\'total_users\'] - $users_counts[\'avail_roles\'][$hidden_role];
$args[\'all\'] = "<a href=\'$url\'$class>" . sprintf( _nx( \'All <span class="count">(%s)</span>\', \'All <span class="count">(%s)</span>\', $total_users, \'users\' ), number_format_i18n( $total_users ) ) . \'</a>\';
unset($args[$hidden_role]);
return $args;
}
add_filter(\'views_users\', \'my_views_users\');
当然,当用户以管理员身份登录时,您应该添加一些if语句来禁用此代码(我想您不想对管理员隐藏用户)。