Skip to content

Instantly share code, notes, and snippets.

@rsharrer
Created September 26, 2013 13:39
Show Gist options
  • Save rsharrer/6714324 to your computer and use it in GitHub Desktop.
Save rsharrer/6714324 to your computer and use it in GitHub Desktop.
Remove admin menu items
//start remove admin menus
function remove_menus() {
global $menu;
$restricted = array(
__('Posts'),
__('Dashboard'),
__('Comments'),
__('Appearance'),
__('Plugins'),
__('Tools'),
__('Settings')
);
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_menus');
//end remove admin menus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment