Make WordPress Core

Changeset 30659


Ignore:
Timestamp:
11/30/2014 07:17:44 PM (10 years ago)
Author:
wonderboymusic
Message:

The menu items for users.php and profile.php that require the promote_users cap should be wrapped in an is_multisite() conditional a la user-new.php.

Props SergeyBiryukov.
Fixes #30526.

File:
1 edited

Legend:

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

    r30459 r30659  
    207207    $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
    208208    $submenu['users.php'][5] = array(__('All Users'), 'list_users', 'users.php');
    209     if ( current_user_can('create_users') )
     209    if ( current_user_can( 'create_users' ) ) {
    210210        $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php');
    211     else
     211    } elseif ( is_multisite() ) {
    212212        $submenu['users.php'][10] = array(_x('Add New', 'user'), 'promote_users', 'user-new.php');
     213    }
    213214
    214215    $submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php');
     
    216217    $_wp_real_parent_file['users.php'] = 'profile.php';
    217218    $submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php');
    218     if ( current_user_can('create_users') )
     219    if ( current_user_can( 'create_users' ) ) {
    219220        $submenu['profile.php'][10] = array(__('Add New User'), 'create_users', 'user-new.php');
    220     else
     221    } elseif ( is_multisite() ) {
    221222        $submenu['profile.php'][10] = array(__('Add New User'), 'promote_users', 'user-new.php');
     223    }
    222224}
    223225
Note: See TracChangeset for help on using the changeset viewer.