On this page
WP_User_Search::query()
Executes the user search query.
Source
File: wp-admin/includes/deprecated.php. View all references
public function query() {
global $wpdb;
$this->results = $wpdb->get_col("SELECT DISTINCT($wpdb->users.ID)" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit);
if ( $this->results )
$this->total_users_for_query = $wpdb->get_var("SELECT COUNT(DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where); // No limit.
else
$this->search_errors = new WP_Error('no_matching_users_found', __('No users found.'));
}
Related
Uses
| Uses | Description |
|---|---|
| wpdb::get_col() wp-includes/class-wpdb.php | Retrieves one column from the database. |
| __() wp-includes/l10n.php | Retrieves the translation of $text. |
| wpdb::get_var() wp-includes/class-wpdb.php | Retrieves one variable from the database. |
| WP_Error::__construct() wp-includes/class-wp-error.php | Initializes the error. |
Used By
| Used By | Description |
|---|---|
| WP_User_Search::__construct() wp-admin/includes/deprecated.php | PHP5 Constructor – Sets up the object properties. |
Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_user_search/query