I've successfully used the code from the post: Restrict ADMIN menu items based on username, replace username with an actual user's name.
The problem is the theme still shows on the main dashboard and by clicking on the theme name the admin is taken to the appearance menu which had been hidden by using the code.
Any thoughts how to get around this?
Here is the code from the post mentioned:
function remove_menus()
{
global $menu;
global $current_user;
get_currentuserinfo();
if($current_user->user_login == 'clients-username')
{
$restricted = array(__('Posts'),
__('Media'),
__('Links'),
__('Pages'),
__('Comments'),
__('Appearance'),
__('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');