WordPress upgrades are always welcome and bring with them more and more options for extended functionality and ease of use. And WordPress 3.1 is no exception. You can read about the new features here, but I am just going to throw out the burning question for many theme developers – how to get rid of that admin bar.
In my case, I developed a custom admin bar for my templates which is overlaid by the new WordPress admin bar. To disable the admin bar, simply visit your user profile in the WordPress admin area under Users/My Profile. Uncheck the boxes next to Show Admin Bar.
For theme developers, you can also disable the admin bar in the functions.php file by adding the following:
/* Disable the Admin Bar By Default */
add_filter( 'show_admin_bar', '__return_false' );
/* Remove the Admin Bar preference in user profile to remove temptation... */
remove_action( 'personal_options', '_admin_bar_preferences' );
And of course, there is always a plugin out there ready to do the work for you with the Disable Admin Bar plugin.
Thanks to summerchilde in the support forum for a better code snippet.