Last active
June 16, 2017 11:50
-
-
Save caercam/6dd7d7727b6d745798f6e1d37e1c5a86 to your computer and use it in GitHub Desktop.
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 | |
function remove_admin_bar_links() { | |
global $wp_admin_bar; | |
if ( ! current_user_can( 'manage_options' ) ) { | |
$wp_admin_bar->remove_menu( 'site-name' ); // Remove the site name menu | |
$wp_admin_bar->remove_menu( 'view-site' ); // Remove the view site link | |
$wp_admin_bar->remove_menu( 'my-account' ); // Remove the user details tab | |
$wp_admin_bar->remove_menu( 'wpmovielibrary' ); // Remove the Movie Library menu | |
} | |
} | |
add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links', 999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment