Correct faulty logic when dealing with autocomplete_users_for_site_admins, and break logic into multiple lines. See #19810.
git-svn-id: https://develop.svn.wordpress.org/trunk@19934 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f7441d78e9
commit
abfcb78ce7
@ -150,8 +150,13 @@ function wp_ajax_oembed_cache() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function wp_ajax_autocomplete_user() {
|
function wp_ajax_autocomplete_user() {
|
||||||
if ( !is_multisite() || !current_user_can( 'promote_users' ) || wp_is_large_network( 'users' ) || !is_super_admin() && apply_filters( 'autocomplete_users_for_site_admins', 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 ) )
|
||||||
|
) {
|
||||||
wp_die( -1 );
|
wp_die( -1 );
|
||||||
|
}
|
||||||
|
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
||||||
@ -1675,4 +1680,4 @@ function wp_ajax_dismiss_wp_pointer() {
|
|||||||
|
|
||||||
update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissed );
|
update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissed );
|
||||||
wp_die( 1 );
|
wp_die( 1 );
|
||||||
}
|
}
|
||||||
|
@ -178,8 +178,13 @@ get_current_screen()->set_help_sidebar(
|
|||||||
|
|
||||||
wp_enqueue_script('wp-ajax-response');
|
wp_enqueue_script('wp-ajax-response');
|
||||||
wp_enqueue_script('user-profile');
|
wp_enqueue_script('user-profile');
|
||||||
if ( is_multisite() && current_user_can( 'promote_users' ) && !wp_is_large_network( 'users' ) && is_super_admin() || apply_filters( 'autocomplete_users_for_site_admins', 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 ) )
|
||||||
|
) {
|
||||||
wp_enqueue_script( 'user-search' );
|
wp_enqueue_script( 'user-search' );
|
||||||
|
}
|
||||||
|
|
||||||
require_once( 'admin-header.php' );
|
require_once( 'admin-header.php' );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user