Make WordPress Core

Changeset 44813


Ignore:
Timestamp:
03/07/2019 12:34:56 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Users: Use login__in parameter for WP_User_Query in WP_MS_Users_List_Table::prepare_items(), instead of a manual query.

Props spacedmonkey.
Fixes #45223.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php

    r42871 r44813  
    2727     * @global string $usersearch
    2828     * @global string $role
    29      * @global wpdb   $wpdb
    3029     * @global string $mode
    3130     */
    3231    public function prepare_items() {
    33         global $usersearch, $role, $wpdb, $mode;
     32        global $usersearch, $role, $mode;
    3433
    3534        $usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';
     
    5756
    5857        if ( $role === 'super' ) {
    59             $logins          = implode( "', '", get_super_admins() );
    60             $args['include'] = $wpdb->get_col( "SELECT ID FROM $wpdb->users WHERE user_login IN ('$logins')" );
     58            $args['login__in'] = get_super_admins();
    6159        }
    6260
Note: See TracChangeset for help on using the changeset viewer.