Disable the WordPress Admin Bar for Non-Admins Only

Here is a variation of some code I found on Yoast.com to disable the WP admin bar for non-admins only.

function yoast_hide_admin_bar_settings() 
{
?>
	<style type="text/css">
		.show-admin-bar {
			display: none;
		}
	</style>
<?php
}
function yoast_disable_admin_bar() 
{
	if(!current_user_can('administrator'))
	{
		add_filter( 'show_admin_bar', '__return_false' );
		add_action( 'admin_print_scripts-profile.php', 'yoast_hide_admin_bar_settings' );
	}
}
add_action('init', 'yoast_disable_admin_bar', 9);

Just copy and paste this code into your functions.php or another plugin/theme file that can add hooks. Save/upload and watch it work.

Let me know if you have any trouble using this.