Skip to content

Instantly share code, notes, and snippets.

@crewstyle
Created April 20, 2016 08:27
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 crewstyle/05a7d50eb5ddb1f55045ee82b8a26ce5 to your computer and use it in GitHub Desktop.
Save crewstyle/05a7d50eb5ddb1f55045ee82b8a26ce5 to your computer and use it in GitHub Desktop.
WordPress ~ Clean admin bar - #backend #optimisation
<?php
/**
* Remove menu items from WordPress admin bar.
*
* @uses remove_menu() To remove specific menu.
* @see https://github.com/crewstyle/clean-wordpress
*/
add_action('wp_before_admin_bar_render', '_cw_remove_bar_icons');
function _cw_remove_bar_icons()
{
global $wp_admin_bar;
//Remove all useless WP bar menus
$wp_admin_bar->remove_menu('wp-logo');
$wp_admin_bar->remove_menu('about');
$wp_admin_bar->remove_menu('comments');
$wp_admin_bar->remove_menu('new-content');
$wp_admin_bar->remove_menu('wporg');
$wp_admin_bar->remove_menu('documentation');
$wp_admin_bar->remove_menu('support-forums');
$wp_admin_bar->remove_menu('feedback');
$wp_admin_bar->remove_menu('view-site');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment