Skip to content

Instantly share code, notes, and snippets.

@andyknapp
Created June 20, 2013 02:17
Show Gist options
  • Save andyknapp/5819847 to your computer and use it in GitHub Desktop.
Save andyknapp/5819847 to your computer and use it in GitHub Desktop.
Remove / add from the WP admin bar I found this useful in a multisite install where I wanted network sites to link back to the main site homepage, as opposed to the individual network site homepage
function ak_admin_bar_nav($wp_toolbar) {
$wp_toolbar->remove_node('comments');
$wp_toolbar->remove_node('new-content');
$wp_toolbar->remove_node('my-sites');
$wp_toolbar->remove_node('wp-logo');
$wp_toolbar->add_node(array(
'id' => 'theid',
'title' => 'A Title',
'href' => 'http://linkurl.com'
));
}
add_action('admin_bar_menu', 'ak_admin_bar_nav', 999);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment