WordPress.org

Support

Support » Plugins and Hacks » Custom Admin Screens Per Username

Custom Admin Screens Per Username

  • I forget where, but I came across this handy code to modify the admin screen for non-administrator accounts…

    function remove_menus () {
    global $menu;
    if( (current_user_can(‘install_themes’)) ) { $restricted = array(__()); }
    else { $restricted = array( __(‘Posts’),__(‘Links’), __(‘Pages’), __(‘Tools’), __(‘Users’), __(‘Settings’), __(‘Profile’)); } // hide these for other roles
    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_menus’);

    …and I was wondering if it is possible to do something similar to this, but for a specific user at a time. For instance, you create a custom post type that you want someone to author, but you don’t want them to have control over anything else on your site.

Viewing 1 replies (of 1 total)
  • dColumbus

    @dcolumbus

    I’d also like to know about this…

    It would be extremely useful for creating pages within the “administration area” for clients, customers, etc.

    Anyone?

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Admin Screens Per Username’ is closed to new replies.