From 9ea224b78f382c128328f835f3fb18dca6da9a6d Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 30 Nov 2014 19:18:23 +0000 Subject: [PATCH] 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 --- wp-admin/menu.php | 10 ++++++---- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/wp-admin/menu.php b/wp-admin/menu.php index fc0fb8d5bb..89c13d9684 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -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' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index d7c720d02b..33843dbd7b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.