Skip to content

Instantly share code, notes, and snippets.

@DerekMarcinyshyn
Created April 11, 2013 17:36
Show Gist options
  • Save DerekMarcinyshyn/5365443 to your computer and use it in GitHub Desktop.
Save DerekMarcinyshyn/5365443 to your computer and use it in GitHub Desktop.
WordPress remove menu pages
add_action( ‘admin_init’, ‘my_remove_menu_pages’ );
function my_remove_menu_pages() {
global $menu;
global $current_user;
get_currentuserinfo();
if($current_user->user_login != ‘ADMINNAME’){
remove_menu_page(‘edit.php’);
remove_submenu_page(‘users.php’,'role-management.php’);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment