From 043cf0fc0010fc067f402718e93fc40dceef7cba Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Fri, 20 Jan 2017 17:42:21 +0000 Subject: [PATCH] Multisite: Replace `is_super_admin()` with `manage_network_users` when checking for users autocomplete capabilities. Props ashokkumar24. Fixes #39201. See #37616. git-svn-id: https://develop.svn.wordpress.org/trunk@39934 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/ajax-actions.php | 2 +- src/wp-admin/user-new.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 516f69f235..1226a9e53e 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -246,7 +246,7 @@ function wp_ajax_autocomplete_user() { wp_die( -1 ); /** 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 ); $return = array(); diff --git a/src/wp-admin/user-new.php b/src/wp-admin/user-new.php index e039d711ef..f26d61edd5 100644 --- a/src/wp-admin/user-new.php +++ b/src/wp-admin/user-new.php @@ -225,7 +225,7 @@ wp_enqueue_script( 'user-profile' ); * @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' ) - && ( 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' ); }