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:
duck_ 2012-02-16 17:12:10 +00:00
parent 8961a61f89
commit af2eb34f8a
2 changed files with 13 additions and 3 deletions

View File

@ -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 );
}
}

View File

@ -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' );