Removing links from admin bar (WordPress)

Always a good option to have a child theme so you can mess around with the css and functions to your hearts content. In one of my recent projects i had to totally custom design/re-develop the WordPress admin bar and over the top we were using buddypress on a mulitisite installation. So from my 2 days of work here is a short hack, to show how to remove the default links on Admin Bar.
< ?php

add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );
function remove_admin_bar_links() {
global $wp_admin_bar;
$wp_admin_bar->remove_node('comments');
$wp_admin_bar->remove_node('updates');
$wp_admin_bar->remove_node('about');
$wp_admin_bar->remove_node('wporg');
$wp_admin_bar->remove_node('documentation');
$wp_admin_bar->remove_node('support-forums');
$wp_admin_bar->remove_node('feedback');

}
?>

%d bloggers like this: