So I found some handy snippets to help remove admin menu items. However, I’m having trouble with the sub menu items. I want to keep the appearance menu, but get rid of the Themes, Widgets, and Editor.
function remove_menus()
{
global $menu;
global $current_user;
get_currentuserinfo();
if($current_user->user_login == 'username')
{
$restricted = array(__('Posts'),
__('Links'),
__('Comments'),
__('Plugins'),
__('Users'),
__('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)]);}
}// end while
}// end if
}
add_action('admin_menu', 'remove_menus');
function remove_submenus()
{
global $menu;
global $current_user;
get_currentuserinfo();
if($current_user->user_login == 'username')
{
global $submenu;
unset($submenu['themes.php'][10]); // remove the theme editor
}
}
add_action('admin_menu', 'remove_menus');