From 127abe718b9d77e8ca285d2b80afe0ebed48447c Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 7 May 2017 17:42:45 +0000 Subject: [PATCH] Users: Correct a permission check when showing the User item in the `+ New` admin toolbar menu. Props dlh Fixes #39252 Built from https://develop.svn.wordpress.org/trunk@40581 git-svn-id: http://core.svn.wordpress.org/trunk@40451 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/admin-bar.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 98a052379c..27266a108c 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -718,8 +718,9 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) { if ( isset( $actions['post-new.php?post_type=content'] ) ) $actions['post-new.php?post_type=content'][1] = 'add-new-content'; - if ( current_user_can( 'create_users' ) || current_user_can( 'promote_users' ) ) + if ( current_user_can( 'create_users' ) || ( is_multisite() && current_user_can( 'promote_users' ) ) ) { $actions[ 'user-new.php' ] = array( _x( 'User', 'add new from admin bar' ), 'new-user' ); + } if ( ! $actions ) return; diff --git a/wp-includes/version.php b/wp-includes/version.php index d041423433..a942caac9f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40580'; +$wp_version = '4.8-alpha-40581'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.