How I can hide WordPress admin panel options for all except one user. I want to hide some setting options and theme options for all users except me (username: jacob).
0
votes
4 Answers
1
votes
This code will hide admin bar for all users:
show_admin_bar( false );
And this one will prevent admin bar from being hidden:
show_admin_bar( false );
So you need to use code for the condition if the username is jacob then show the admin bar and hide it for all the others. So here is the complete code.
global $current_user;
get_currentuserinfo();
if ( is_user_logged_in() ) {
if($current_user->user_login == 'jacob') {
show_admin_bar( true );
} else {
show_admin_bar( false );
} } else {
show_admin_bar( false );
}
You can use this code inside your theme's functions.php or you can also create separate plugin for this.
0
votes
0
votes
If you have users that are logging in, you can re-direct around the Admin - check perms..
Better yet, send them around it!!
Have a look here - https://wordpress.org/plugins/peters-login-redirect/
I use this on our church website and works great!
Thanks!