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.

Built from https://develop.svn.wordpress.org/trunk@30659


git-svn-id: http://core.svn.wordpress.org/trunk@30649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-11-30 19:18:23 +00:00
parent 3f39605b02
commit 9ea224b78f
2 changed files with 7 additions and 5 deletions

View File

@ -206,19 +206,21 @@ else
if ( current_user_can('list_users') ) {
$_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
$submenu['users.php'][5] = array(__('All Users'), 'list_users', 'users.php');
if ( current_user_can('create_users') )
if ( current_user_can( 'create_users' ) ) {
$submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php');
else
} elseif ( is_multisite() ) {
$submenu['users.php'][10] = array(_x('Add New', 'user'), 'promote_users', 'user-new.php');
}
$submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php');
} else {
$_wp_real_parent_file['users.php'] = 'profile.php';
$submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php');
if ( current_user_can('create_users') )
if ( current_user_can( 'create_users' ) ) {
$submenu['profile.php'][10] = array(__('Add New User'), 'create_users', 'user-new.php');
else
} elseif ( is_multisite() ) {
$submenu['profile.php'][10] = array(__('Add New User'), 'promote_users', 'user-new.php');
}
}
$menu[75] = array( __('Tools'), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'dashicons-admin-tools' );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.1-beta2-30658';
$wp_version = '4.1-beta2-30659';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.