mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-04 20:11:39 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@44813 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -26,11 +26,10 @@ class WP_MS_Users_List_Table extends WP_List_Table {
|
|||||||
/**
|
/**
|
||||||
* @global string $usersearch
|
* @global string $usersearch
|
||||||
* @global string $role
|
* @global string $role
|
||||||
* @global wpdb $wpdb
|
|
||||||
* @global string $mode
|
* @global string $mode
|
||||||
*/
|
*/
|
||||||
public function prepare_items() {
|
public function prepare_items() {
|
||||||
global $usersearch, $role, $wpdb, $mode;
|
global $usersearch, $role, $mode;
|
||||||
|
|
||||||
$usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';
|
$usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';
|
||||||
|
|
||||||
@@ -56,8 +55,7 @@ class WP_MS_Users_List_Table extends WP_List_Table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $role === 'super' ) {
|
if ( $role === 'super' ) {
|
||||||
$logins = implode( "', '", get_super_admins() );
|
$args['login__in'] = get_super_admins();
|
||||||
$args['include'] = $wpdb->get_col( "SELECT ID FROM $wpdb->users WHERE user_login IN ('$logins')" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user