WordPress.org

Make WordPress Core

Changeset 19934


Ignore:
Timestamp:
02/16/2012 05:12:10 PM (9 years ago)
Author:
duck_
Message:

Correct faulty logic when dealing with autocomplete_users_for_site_admins, and break logic into multiple lines. See #19810.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ajax-actions.php

    r19902 r19934  
    151151
    152152function wp_ajax_autocomplete_user() {
    153     if ( !is_multisite() || !current_user_can( 'promote_users' ) || wp_is_large_network( 'users' ) || !is_super_admin() && apply_filters( 'autocomplete_users_for_site_admins', false ) )
    154         wp_die( -1 );
     153    if ( ! is_multisite()
     154        || ! current_user_can( 'promote_users' )
     155        || wp_is_large_network( 'users' )
     156        || ( ! is_super_admin() && ! apply_filters( 'autocomplete_users_for_site_admins', false ) )
     157    ) {
     158        wp_die( -1 );
     159    }
    155160   
    156161    $return = array();
  • trunk/wp-admin/user-new.php

    r19897 r19934  
    179179wp_enqueue_script('wp-ajax-response');
    180180wp_enqueue_script('user-profile');
    181 if ( is_multisite() && current_user_can( 'promote_users' ) && !wp_is_large_network( 'users' ) && is_super_admin() || apply_filters( 'autocomplete_users_for_site_admins', false ) )
     181if ( is_multisite()
     182    && current_user_can( 'promote_users' )
     183    && ! wp_is_large_network( 'users' )
     184    && ( is_super_admin() || apply_filters( 'autocomplete_users_for_site_admins', false ) )
     185) {
    182186    wp_enqueue_script( 'user-search' );
     187}
    183188
    184189require_once( 'admin-header.php' );
Note: See TracChangeset for help on using the changeset viewer.