Multisite: Replace `is_super_admin()` with `manage_network_users` when checking for users autocomplete capabilities.

Props ashokkumar24.
Fixes #39201. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz 2017-01-20 17:43:42 +00:00
parent 6e5cd6d397
commit c22fea9120
3 changed files with 3 additions and 3 deletions

View File

@ -246,7 +246,7 @@ function wp_ajax_autocomplete_user() {
wp_die( -1 ); wp_die( -1 );
/** This filter is documented in wp-admin/user-new.php */ /** This filter is documented in wp-admin/user-new.php */
if ( ! is_super_admin() && ! apply_filters( 'autocomplete_users_for_site_admins', false ) ) if ( ! current_user_can( 'manage_network_users' ) && ! apply_filters( 'autocomplete_users_for_site_admins', false ) )
wp_die( -1 ); wp_die( -1 );
$return = array(); $return = array();

View File

@ -225,7 +225,7 @@ wp_enqueue_script( 'user-profile' );
* @param bool $enable Whether to enable auto-complete for non-super admins. Default false. * @param bool $enable Whether to enable auto-complete for non-super admins. Default false.
*/ */
if ( is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' ) if ( is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' )
&& ( is_super_admin() || apply_filters( 'autocomplete_users_for_site_admins', false ) ) && ( current_user_can( 'manage_network_users' ) || apply_filters( 'autocomplete_users_for_site_admins', false ) )
) { ) {
wp_enqueue_script( 'user-suggest' ); wp_enqueue_script( 'user-suggest' );
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.8-alpha-39933'; $wp_version = '4.8-alpha-39934';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.