WordPress show admin bar only for Admin

In some situations it is helpful to don’t show the WordPress admin bar to all the user types. By adding the following code to your function.php, the admin bar only shows up when your logged in as Administrator.

// show admin bar only for admins
if (!current_user_can('manage_options')) {
 add_filter('show_admin_bar', '__return_false');
}