Created
November 22, 2013 00:55
-
-
Save FriendlyWP/7592826 to your computer and use it in GitHub Desktop.
Remove menu items (hide menu items) for everyone except a specific user.
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
/* | |
* See http://wordpress.stackexchange.com/a/28784/16 for all options | |
*/ | |
add_action( 'admin_menu', 'my_remove_menu_pages', 9999 ); | |
function my_remove_menu_pages() { | |
global $current_user; | |
$username = $current_user->user_login; | |
if ($username !== 'SPECIFIC-ADMIN-USERNAME-HERE') { | |
remove_menu_page('edit-comments.php'); | |
remove_menu_page('edit.php?post_type=acf'); | |
remove_menu_page('plugins.php'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment