Skip to content

Instantly share code, notes, and snippets.

@trevorgreenleaf
Created May 22, 2013 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trevorgreenleaf/5629502 to your computer and use it in GitHub Desktop.
Save trevorgreenleaf/5629502 to your computer and use it in GitHub Desktop.
Modify the admin menus for all users
/remove_menu_items - Modify the menus for all users
//==================================================================
function remove_menu_items()
{
global $menu;
$restricted = array(
__('Links'),
//__('Posts'),
//__('Comments'),
//__('Media'),
//__('Plugins'),
//__('Tools'),
//__('Users')
);
end ($menu);
while (prev($menu)){
$value = explode(' ',$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){
unset($menu[key($menu)]);}
}
}
add_action('admin_menu', 'remove_menu_items');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment