Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Add code at below to your functions.php file
- add_action('pre_user_query','yoursite_pre_user_query');
- function yoursite_pre_user_query($user_search) {
- global $current_user;
- $username = $current_user->user_login;
- if ($username == 'YOUR_USER_ID') {
- global $wpdb;
- $user_search->query_where = str_replace('WHERE 1=1',
- "WHERE 1=1 AND {$wpdb->users}.user_login != 'YOUR_USER_ID'",$user_search->query_where);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement