Created
April 20, 2016 08:27
-
-
Save crewstyle/05a7d50eb5ddb1f55045ee82b8a26ce5 to your computer and use it in GitHub Desktop.
WordPress ~ Clean admin bar - #backend #optimisation
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
<?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