Created
June 20, 2013 02:17
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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