WordPress.org

Ready to get started?Download WordPress

Forums

Custom Admin Screens Per Username (2 posts)

  1. alanchrishughes
    Member
    Posted 3 years ago #

    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.

  2. dColumbus
    Member
    Posted 2 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.