Created
March 28, 2014 04:25
-
-
Save dsebao/9825410 to your computer and use it in GitHub Desktop.
Remove submenu in Admin Bar WordPress
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 | |
/* | |
* | |
* | |
* REMOVER WORDPRESS SUBMENU EN ADMIN BAR | |
* | |
* | |
*/ | |
if (!current_user_can('administrator')): | |
add_action( 'admin_bar_menu', 'remove_wp_nodes', 999 ); | |
function remove_wp_nodes() | |
{ | |
global $wp_admin_bar; | |
$wp_admin_bar->remove_node( 'new-link' ); | |
$wp_admin_bar->remove_node( 'new-media' ); | |
$wp_admin_bar->remove_node( 'new-page' ); | |
} | |
endif; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment