Created
April 11, 2015 07:29
-
-
Save freezvd/11cb75313ddeb90fbdc5 to your computer and use it in GitHub Desktop.
Removing Items from admin bar
This file contains hidden or 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 links/menus from the admin bar | |
* | |
* Comment out what you want to keep. | |
* | |
* @author Vajrasar Goswami ([email protected]) | |
* | |
* @see https://codex.wordpress.org/Class_Reference/WP_Admin_Bar | |
* @see https://codex.wordpress.org/remove_node | |
*/ | |
function vg_custom_admin_bar() { | |
global $wp_admin_bar; | |
$wp_admin_bar->remove_node( 'wp-logo' ); | |
$wp_admin_bar->remove_node( 'site-name' ); | |
$wp_admin_bar->remove_node( 'updates' ); | |
$wp_admin_bar->remove_node( 'comments' ); | |
$wp_admin_bar->remove_node( 'new-content' ); | |
$wp_admin_bar->remove_node( 'edit' ); | |
} | |
add_action( 'wp_before_admin_bar_render', 'vg_custom_admin_bar' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment