Skip to content

Instantly share code, notes, and snippets.

@spencejs
Created March 22, 2013 05:38
Show Gist options
  • Select an option

  • Save spencejs/5219197 to your computer and use it in GitHub Desktop.

Select an option

Save spencejs/5219197 to your computer and use it in GitHub Desktop.
Remove Admin Menu Items In Wordpress
//Remove Admin Menu Items
function remove_menu_items() {
global $menu;
$restricted = array(__('Links'), __('Posts'));
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