Correct faulty logic when dealing with autocomplete_users_for_site_admins, and break logic into multiple lines. See #19810.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8961a61f89
commit
af2eb34f8a
|
@ -150,8 +150,13 @@ function wp_ajax_oembed_cache() {
|
|||
}
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
$return = array();
|
||||
|
||||
|
@ -1675,4 +1680,4 @@ function wp_ajax_dismiss_wp_pointer() {
|
|||
|
||||
update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissed );
|
||||
wp_die( 1 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,8 +178,13 @@ get_current_screen()->set_help_sidebar(
|
|||
|
||||
wp_enqueue_script('wp-ajax-response');
|
||||
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' );
|
||||
}
|
||||
|
||||
require_once( 'admin-header.php' );
|
||||
|
||||
|
|
Loading…
Reference in New Issue