Skip to content

Instantly share code, notes, and snippets.

@aliciaduffy
Last active October 8, 2015 17:08
Show Gist options
  • Save aliciaduffy/3362665 to your computer and use it in GitHub Desktop.
Save aliciaduffy/3362665 to your computer and use it in GitHub Desktop.
WordPress / ADMIN / Remove items from Admin Bar
<?php
add_action( 'wp_before_admin_bar_render', 'NAME_admin_bar_render' );
function NAME_admin_bar_render() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('comments');
$wp_admin_bar->remove_menu('new-content');
$wp_admin_bar->remove_menu('wpseo-menu');
}
/**
* OPTIONS:
* my-account / my-account-with-avatar : the first link, to your account. Note that the ID here changes depending on if you have Avatars enabled or not.
* my-blogs : the ‘My Sites’ menu if the user has more than one site
* get-shortlink : provides a Shortlink to that page
* edit : link to Edit [content-type]
* new-content : the ‘Add New’ dropdown
* comments : the ‘Comments’ dropdown
* appearance : the ‘Appearance’ dropdown
* updates : the ‘Updates’ dropdown
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment