WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/09/2011 05:30:26 PM (7 years ago)
Author:
ryan
Message:

Add additional promote_users checks. Show Add existing button only for multisite. Don't show bulk actions if user can't promote users. Show add new user menu if user has create_users but not promote_users. Props nacin. fixes #16501 for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/menu.php

    r17267 r17431  
    192192    $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
    193193    $submenu['users.php'][5] = array(__('Users'), 'list_users', 'users.php');
    194     $submenu['users.php'][10] = array(_x('Add New', 'user'), 'promote_users', 'user-new.php');
     194    if ( current_user_can('create_users') )
     195        $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php');
     196    else
     197        $submenu['users.php'][10] = array(_x('Add New', 'user'), 'promote_users', 'user-new.php');
    195198
    196199    $submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php');
     
    198201    $_wp_real_parent_file['users.php'] = 'profile.php';
    199202    $submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php');
    200     $submenu['profile.php'][10] = array(__('Add New User'), 'promote_users', 'user-new.php');
     203    if ( current_user_can('create_users') )
     204        $submenu['profile.php'][10] = array(__('Add New User'), 'create_users', 'user-new.php');
     205    else
     206        $submenu['profile.php'][10] = array(__('Add New User'), 'promote_users', 'user-new.php');
    201207}
    202208
Note: See TracChangeset for help on using the changeset viewer.