From 51c38bec8b173f4f9379482bd28ee022c86aae19 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Fri, 20 Jan 2017 17:48:31 +0000 Subject: [PATCH] Multisite: Replace `is_super_admin()` with `manage_network_users` when trying to add an existing user via username. Props dhanendran. Fixes #39202. See #37616. git-svn-id: https://develop.svn.wordpress.org/trunk@39935 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/user-new.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/user-new.php b/src/wp-admin/user-new.php index f26d61edd5..16c65301c2 100644 --- a/src/wp-admin/user-new.php +++ b/src/wp-admin/user-new.php @@ -37,7 +37,7 @@ if ( isset($_REQUEST['action']) && 'adduser' == $_REQUEST['action'] ) { if ( false !== strpos( $user_email, '@' ) ) { $user_details = get_user_by( 'email', $user_email ); } else { - if ( is_super_admin() ) { + if ( current_user_can( 'manage_network_users' ) ) { $user_details = get_user_by( 'login', $user_email ); } else { wp_redirect( add_query_arg( array('update' => 'enter_email'), 'user-new.php' ) ); @@ -313,7 +313,7 @@ if ( ! empty( $messages ) ) { if ( is_multisite() ) { if ( $do_both ) echo '

' . __( 'Add Existing User' ) . '

'; - if ( !is_super_admin() ) { + if ( ! current_user_can( 'manage_network_users' ) ) { echo '

' . __( 'Enter the email address of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '

'; $label = __('Email'); $type = 'email';