Hide Admin from user list
-
I having this annoying problem, need to hide the Administrator for the other users at the user list…like in the image:
https://drive.google.com/file/d/0Bzqs439iIKtxSGlWLXNTbVp2Wmc/edit?usp=sharingso..i need the shop manager just see hes own account or the other clientes future accounts, but not the administrator account.
I tried all things saw online but nothing works, like:
add_action(‘pre_user_search’,’yoursite_pre_user_search’);
function yoursite_pre_user_search($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);
}
}please im pretty newby,someone can help me?
- The topic ‘Hide Admin from user list’ is closed to new replies.