WP_User_Search::query() WordPress Method
The WP_User_Search::query() method is used to query the WordPress user database. It accepts two parameters: a SQL query and an array of arguments. The SQL query is used to search the database for users. The array of arguments is used to specify the fields to be returned.
WP_User_Search::query() #
Executes the user search query.
Source
File: wp-admin/includes/deprecated.php
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.')); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |