Site icon Hip-Hop Website Design and Development

Disguise Admin menus per position in WordPress

I’m making an attempt to cover a specific amount of menus for a shopper. Proper now I’m utilizing the next code and it’s doing its job properly, but it surely removes it for everybody so far as I can inform. As in all roles.

operate remove_menus () {
world $menu;
    $restricted = array(__('Dashboard'), __('Media'), __('Hyperlinks'),      __('Look'), __('Instruments'), __('Customers'), __('Settings'), __('Profile'),__('Plugins'));
    finish ($menu);
    whereas (prev($menu)){
        $worth = explode(' ',$menu[key($menu)][0]);
        if(in_array($worth[0] != NULL?$worth[0]:"" , $restricted)){unset($menu[key($menu)]);}
    }
}
add_action('admin_menu', 'remove_menus');

What’s the line I might use to have this name out solely an editor or an creator and so on?

Thanks a lot