• Hi, I want to hide the entire left admin menu for the subscriber role without disrupting the Wp core files. Id like to get rid of everything including the divs. So all the Subscriber will see is just the remaining right “content area” of the wp Admin.

    I have manged to hide all the menu items with this great piece of code

    function remove_menu_items() {
      global $menu;
      $restricted = array(__('Links'), __('Comments'), __('Media'),
      __('Plugins'), __('Tools'), __('Users'), __('Pages'), __('Posts'), __('Dashboard'), __('Forms'), __('Appearance'), __('Settings'),__('Products'));
      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');
    ?>

    But I don’t know how to get rid of the entire menu “Block”.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide the left admin menu for a user role’ is closed to new replies.