Skip to content

Instantly share code, notes, and snippets.

@plasticmind
Created December 13, 2012 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plasticmind/4277101 to your computer and use it in GitHub Desktop.
Save plasticmind/4277101 to your computer and use it in GitHub Desktop.
Remove unnecessary items from the admin bar
// Remove unnecessary items from the admin bar
function gist_custom_admin_bar_remove() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('wp-logo');
// $wp_admin_bar->remove_menu('comments');
$wp_admin_bar->remove_menu('new-media');
$wp_admin_bar->remove_menu('new-link');
$wp_admin_bar->remove_menu('new-user');
$wp_admin_bar->remove_menu('new-theme');
$wp_admin_bar->remove_menu('new-plugin');
$wp_admin_bar->remove_menu('appearance');
$wp_admin_bar->remove_menu('w3tc');
}
add_action('wp_before_admin_bar_render', 'gist_custom_admin_bar_remove', 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment