One of the awesome new features of WordPress 3.1 is the inclusion of an admin bar like the one seen on WordPress.com blogs. WordPress 3.1 allows the individual user to choose whether or not they want to see the admin bar by editing the settings in their user profile. Checking off the boxes there will hide it.
As great as this new feature is, suppose you don’t want anyone to see an admin bar on your site. Maybe it conflicts with your site design or you just don’t like the functionality. Removing the admin bar is easy, just add the following to your theme functions.php:
/ Disable the Admin Bar. / add_filter( 'show_admin_bar', '__return_false' ); / Remove the Admin Bar preference in user profile / remove_action( 'personal_options', '_admin_bar_preferences' );
If you want to hide it from everyone except the admins you can use this instead:
/ Disable the Admin Bar for all but admins. /
if(!current_user_can('administrator')):
show_admin_bar(false);
endif;
/ Remove the Admin Bar preference in user profile /
remove_action( 'personal_options', '_admin_bar_preferences' );
Note: This is for self-hosted blogs running WordPress 3.1 only.
No Comments so far ↓
There are no comments yet...Kick things off by filling out the form below.