Hide specific user
-
Hey.
I have been able to hide the webmaster username from the normal user list using something like this:add_action(‘pre_user_query’,’yoursite_pre_user_query’);
function yoursite_pre_user_query($user_search) {
$user = wp_get_current_user();
if ($user->ID!=1) { // Is not administrator, remove administrator
global $wpdb;
$user_search->query_where = str_replace(‘WHERE 1=1’,
“WHERE 1=1 AND {$wpdb->users}.ID<>1”,$user_search->query_where);
}
}— however, when I visit the New User Approve/Deny area, it is not effected by the code.
I have tried adding that code to the user-list.php file, but it is causing errors.Any thoughts?
Goal is to have just a specific user name not displayed in the list.
Thanks.
- The topic ‘Hide specific user’ is closed to new replies.