$this->query_where = " WHERE 1=1
$search_sql";
if ( $this->role
) { $this->query_from .= " INNER JOIN
$wpdb->usermeta ON
$wpdb->users.ID =
$wpdb->usermeta.user_id";
$this->query_where .=
$wpdb->
prepare(" AND
$wpdb->usermeta.meta_key = '{
$wpdb->prefix
}capabilities' AND
$wpdb->usermeta.meta_value LIKE %s", '%' .
$this->role . '%'
);
} elseif ( is_multisite() ) { $level_key =
$wpdb->prefix . 'capabilities'; // WPMU site admins don't have user_levels.
$this->query_from .= ",
$wpdb->usermeta";
$this->query_where .= " AND
$wpdb->users.ID =
$wpdb->usermeta.user_id AND meta_key = '{
$level_key}'";
} do_action_ref_array( 'pre_user_search', array
( &
$this ) );
} /**
* Executes the user search query.
*
* @since 2.1.0
* @access public
*
* @global wpdb $wpdb WordPress database abstraction object.
*/
public function query() {