WP_User_Query::prepare_query( string|array $query = array() )
- Since
- 3.1.0, 4.1.0, 4.2.0, 4.3.0, 4.4.0, 4.7.0, 5.1.0, 5.3.0, 5.9.0, 6.3.0
- Source
wp-includes/class-wp-user-query.php:265
Compatibility
- WordPress
- since 6.3.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$querystring|arrayoptional- Array or string of query parameters.Default:
array()$blog_idintdefault: is the current siteThe site ID.$rolestring|string[]default: emptyAn array or a comma-separated list of role names that users must match to be included in results. Note that this is an inclusive list: users must match each role.$role__instring[]default: empty arrayAn array of role names. Matched users must have at least one of these roles.$role__not_instring[]default: empty arrayAn array of role names to exclude. Users matching one or more of these roles will not be included in results.$meta_keystring|string[]Meta key or keys to filter by.$meta_valuestring|string[]Meta value or values to filter by.$meta_comparestringMySQL operator used for comparing the meta value. See WP_Meta_Query::construct() for accepted values and default value.$meta_compare_keystringMySQL operator used for comparing the meta key. See WP_Meta_Query::</strong>construct() for accepted values and default value.$meta_typestringMySQL data type that the meta_value column will be CAST to for comparisons. See WP_Meta_Query::construct() for accepted values and default value.$meta_type_keystringMySQL data type that the meta_key column will be CAST to for comparisons. See WP_Meta_Query::__construct() for accepted values and default value.$meta_queryarrayAn associative array of WP_Meta_Query arguments. See WP_Meta_Query::</strong>construct() for accepted values.$capabilitystring|string[]default: emptyAn array or a comma-separated list of capability names that users must match to be included in results. Note that this is an inclusive list: users must match each capability. Does NOT work for capabilities not in the database or filtered via 'map_meta_cap'.$capability__instring[]default: empty arrayAn array of capability names. Matched users must have at least one of these capabilities. Does NOT work for capabilities not in the database or filtered via 'map_meta_cap'.$capability__not_instring[]default: empty arrayAn array of capability names to exclude. Users matching one or more of these capabilities will not be included in results. Does NOT work for capabilities not in the database or filtered via 'map_meta_cap'.$includeint[]default: empty arrayAn array of user IDs to include.$excludeint[]default: empty arrayAn array of user IDs to exclude.$searchstringdefault: emptySearch keyword. Searches for possible string matches on columns. When$search_columnsis left empty, it tries to determine which column to search in based on search string.$search_columnsstring[]default: empty arrayArray of column names to be searched. Accepts 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename', 'display_name'.$orderbystring|arraydefault: 'user_login'Field(s) to sort the retrieved users by. May be a single value, an array of values, or a multi-dimensional array with fields as keys and orders ('ASC' or 'DESC') as values. Accepted values are: - 'ID' - 'display_name' (or 'name') - 'include' - 'user_login' (or 'login') - 'login__in' - 'user_nicename' (or 'nicename') - 'nicename__in' - 'user_email' (or 'email') - 'user_url' (or 'url') - 'user_registered' (or 'registered') - 'post_count' - 'meta_value' - 'meta_value_num' - The value of$meta_key- An array key of$meta_queryTo use 'meta_value' or 'meta_value_num',$meta_keymust be also be defined.$orderstringdefault: 'ASC'Designates ascending or descending order of users. Order values passed as part of an$orderbyarray take precedence over this parameter. Accepts 'ASC', 'DESC'.$offsetintdefault: 0Number of users to offset in retrieved results. Can be used in conjunction with pagination.$numberintdefault: -1 (all users)Number of users to limit the query for. Can be used in conjunction with pagination. Value -1 (all) is supported, but should be used with caution on larger sites.$pagedintdefault: 1When used with number, defines the page of results to return.$count_totalbooldefault: trueWhether to count the total number of users found. If pagination is not needed, setting this to false can improve performance.$fieldsstring|string[]default: 'all'Which fields to return. Single or all fields (string), or array of fields. Accepts:- 'ID'
- 'display_name'
- 'user_login'
- 'user_nicename'
- 'user_email'
- 'user_url'
- 'user_registered'
- 'user_pass'
- 'user_activation_key'
- 'user_status'
- 'spam' (only available on multisite installs)
- 'deleted' (only available on multisite installs)
- 'all' for all fields and loads user meta
- 'all_with_meta' Deprecated. Use 'all'
$whostringdefault: empty (all users)Deprecated, use$capabilityinstead. Type of users to query. Accepts 'authors'.$has_published_postsbool|string[]Pass an array of post types to filter results to users who have published posts in those post types.trueis an alias for all public post types.$nicenamestringdefault: emptyThe user nicename.$nicename__instring[]default: empty arrayAn array of nicenames to include. Users matching one of these nicenames will be included in results.$nicename__not_instring[]default: empty arrayAn array of nicenames to exclude. Users matching one of these nicenames will not be included in results.$loginstringdefault: emptyThe user login.$login__instring[]default: empty arrayAn array of logins to include. Users matching one of these logins will be included in results.$login__not_instring[]default: empty arrayAn array of logins to exclude. Users matching one of these logins will not be included in results.$cache_resultsbooldefault: trueWhether to cache user information.
Performance profile
How much work a call to WP_User_Query::prepare_query() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Trivial
- Scaling
- Constant
- Instructions
- 184–269
- Plugin surface
- 3 hooks
- Called by
- 1
Touches nothing outside its own arguments.
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 910.
Third-party callbacks on 'pre_get_users', 'user_search_columns', 'pre_user_query' run inside this call, and their cost is not bounded by anything here.
1 place in core call this, so the cost is paid more often than your own code shows.
What it touches
- hookthird-party callbacks
do_action_ref_array()called directly - regexregular expression over the whole input
preg_split()called directly
Further down the call graph this can also reach option, cache, serialize, query and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 28 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost WP_User_Query::prepare_query() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
empty($value) && !is_multisite() && !isset($qv) && !$qv && !empty($orderby_array) | 184–195 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split() |
empty($value) && !is_multisite() && !isset($qv) && !$qv && !empty($orderby_array) && empty($include) | 198–201 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), wp_parse_id_list() |
empty($value) && !is_multisite() && !isset($qv) && !$qv && !empty($orderby_array) | 198–206 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), user_login(), ->get_sql() |
empty($value) && !is_multisite() && !isset($qv) && !$qv && !empty($orderby_array) && empty($include) | 212 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), wp_parse_id_list(), user_login(), ->get_sql() |
empty($value) && !is_multisite() && !isset($qv) && !$qv && !empty($orderby_array) && $search === false | 217–238 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), apply_filters(), ->get_search_sql() |
empty($value) && !is_multisite() && !isset($qv) && !empty($orderby_array) && $search === false | 223–244 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), array_intersect(), apply_filters(), ->get_search_sql() |
empty($value) && !is_multisite() && !isset($qv) && !$qv && !empty($orderby_array) && $search === false | 228–242 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), is_multisite(), apply_filters(), ->get_search_sql() |
empty($value) && !is_multisite() && !isset($qv) && !$qv && !empty($orderby_array) && $search === false && empty($include) | 231–244 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), apply_filters(), ->get_search_sql(), wp_parse_id_list() |
empty($value) && !is_multisite() && !isset($qv) && !$qv && !empty($orderby_array) && $search === false | 231–249 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), apply_filters(), ->get_search_sql(), user_login(), ->get_sql() |
empty($value) && !isset($qv) && !$qv && !empty($orderby_array) && $search === false | 231–246 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), is_multisite(), wp_is_large_network(), apply_filters(), ->get_search_sql() |
empty($value) && !is_multisite() && !isset($qv) && !empty($orderby_array) && $search === false | 234–248 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), array_intersect(), is_multisite(), apply_filters(), ->get_search_sql() |
empty($value) && !is_multisite() && !isset($qv) && !empty($orderby_array) && $search === false && empty($include) | 237–250 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), array_intersect(), apply_filters(), ->get_search_sql(), wp_parse_id_list() |
16 further outcomes, up to 269 instructions
empty($value) && !is_multisite() && !isset($qv) && !empty($orderby_array) && $search === false | 237–255 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), array_intersect(), apply_filters(), ->get_search_sql(), user_login(), ->get_sql() |
empty($value) && !isset($qv) && !empty($orderby_array) && $search === false | 237–252 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), array_intersect(), is_multisite(), wp_is_large_network(), apply_filters(), ->get_search_sql() |
empty($value) && !is_multisite() && !isset($qv) && !$qv && !empty($orderby_array) && $search === false && empty($include) | 242–248 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), is_multisite(), apply_filters(), ->get_search_sql(), wp_parse_id_list() |
empty($value) && !is_multisite() && !isset($qv) && !$qv && !empty($orderby_array) && $search === false | 242–253 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), is_multisite(), apply_filters(), ->get_search_sql(), user_login(), ->get_sql() |
empty($value) && !is_multisite() && !isset($qv) && !$qv && !empty($orderby_array) && $search === false && empty($include) | 245–255 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), apply_filters(), ->get_search_sql(), wp_parse_id_list(), user_login(), ->get_sql() |
empty($value) && !isset($qv) && !$qv && !empty($orderby_array) && $search === false && empty($include) | 245–252 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), is_multisite(), wp_is_large_network(), apply_filters(), ->get_search_sql(), wp_parse_id_list() |
empty($value) && !isset($qv) && !$qv && !empty($orderby_array) && $search === false | 245–257 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), is_multisite(), wp_is_large_network(), apply_filters(), ->get_search_sql(), user_login(), ->get_sql() |
empty($value) && !is_multisite() && !isset($qv) && !empty($orderby_array) && $search === false && empty($include) | 248–254 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), array_intersect(), is_multisite(), apply_filters(), ->get_search_sql(), wp_parse_id_list() |
empty($value) && !is_multisite() && !isset($qv) && !empty($orderby_array) && $search === false | 248–259 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), array_intersect(), is_multisite(), apply_filters(), ->get_search_sql(), user_login(), ->get_sql() |
empty($value) && !is_multisite() && !isset($qv) && !empty($orderby_array) && $search === false && empty($include) | 251–261 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), array_intersect(), apply_filters(), ->get_search_sql(), wp_parse_id_list(), user_login(), ->get_sql() |
empty($value) && !isset($qv) && !empty($orderby_array) && $search === false && empty($include) | 251–258 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), array_intersect(), is_multisite(), wp_is_large_network(), apply_filters(), ->get_search_sql(), wp_parse_id_list() |
empty($value) && !isset($qv) && !empty($orderby_array) && $search === false | 251–263 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), array_intersect(), is_multisite(), wp_is_large_network(), apply_filters(), ->get_search_sql(), user_login(), ->get_sql() |
empty($value) && !is_multisite() && !isset($qv) && !$qv && !empty($orderby_array) && $search === false && empty($include) | 256–259 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), is_multisite(), apply_filters(), ->get_search_sql(), wp_parse_id_list(), user_login(), ->get_sql() |
empty($value) && !isset($qv) && !$qv && !empty($orderby_array) && $search === false && empty($include) | 259–263 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), is_multisite(), wp_is_large_network(), apply_filters(), ->get_search_sql(), wp_parse_id_list(), user_login(), ->get_sql() |
empty($value) && !is_multisite() && !isset($qv) && !empty($orderby_array) && $search === false && empty($include) | 262–265 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), array_intersect(), is_multisite(), apply_filters(), ->get_search_sql(), wp_parse_id_list(), user_login(), ->get_sql() |
empty($value) && !isset($qv) && !empty($orderby_array) && $search === false && empty($include) | 265–269 | ->fill_query_vars(), ->fill_query_vars(), is_multisite(), do_action_ref_array(), ->parse_query_vars(), ->for_site(), array_merge(), array_merge(), array_unique(), array_unique(), array_unique(), ->parse_order(), preg_split(), ltrim(), rtrim(), array_intersect(), is_multisite(), wp_is_large_network(), apply_filters(), ->get_search_sql(), wp_parse_id_list(), user_login(), ->get_sql() |
This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 907 | 184–269 | 114 | 3 fewer instructions than PHP 8.5 |
| 8.5 | 910 | 184–269 | 114 | |
| 8.4 | 910 | 184–269 | 114 | 58 fewer instructions than PHP 8.3 |
| 8.3 | 968 | 187–287 | 114 | |
| 8.2 | 968 | 187–287 | 114 | |
| 8.1 | 968 | 187–287 | 114 | |
| 7.4 | 968 | 187–287 | 114 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Hooks and filters fired · 3
3 hooks fire while WP_User_Query::prepare_query() runs, in this order:
- do_action( pre_get_users )actionline 283 (+18 into the body)
Fires before the WP_User_Query has been parsed.
- apply_filters( user_search_columns )filterline 741 (+476 into the body)
Filters the columns to search in a WP_User_Query search.
- do_action( pre_user_query )actionline 772 (+507 into the body)
Fires after the WP_User_Query has been parsed, and before the query is executed.
Uses · 17
- do_action_ref_array()Calls the callback functions that have been added to an action hook, specifying arguments in an array.
- is_multisite()Determines whether Multisite is enabled.
- sanitize_key()Sanitizes a string key.
- wp_parse_id_list()Cleans up an array, comma- or space-separated list of IDs.
- absint()Converts a value to non-negative integer.
- get_post_types()Gets a list of all registered post type objects.
- _deprecated_argument()Marks a function argument as deprecated and inform when it has been used.
- __()Retrieves the translation of $text.
- str_contains()Polyfill for `str_contains()` function added in PHP 8.0.
- wp_is_large_network()Determines whether or not we have a large network.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- WP_User_Query::fill_query_vars()Fills in missing query variables with default values.
Show all 17
- WP_Meta_Query::__construct()Constructor.
- WP_User_Query::parse_order()Parses an 'order' query variable and casts it to ASC or DESC as necessary.
- WP_User_Query::parse_orderby()Parses and sanitizes 'orderby' keys passed to the user query.
- WP_User_Query::get_search_sql()Used internally to generate an SQL string for searching across multiple columns.
- WP_Date_Query::__construct()Constructor.
Used by · 1
- WP_User_Query::__construct()Constructor.
Source code
public function prepare_query( $query = array() ) { global $wpdb, $wp_roles; if ( empty( $this->query_vars ) || ! empty( $query ) ) { $this->query_limit = null; $this->query_vars = $this->fill_query_vars( $query ); } /** * Fires before the WP_User_Query has been parsed. * * The passed WP_User_Query object contains the query variables, * not yet passed into SQL. * * @since 4.0.0 * * @param WP_User_Query $query Current instance of WP_User_Query (passed by reference). */ do_action_ref_array( 'pre_get_users', array( &$this ) ); // Ensure that query vars are filled after 'pre_get_users'. $qv =& $this->query_vars; $qv = $this->fill_query_vars( $qv ); $allowed_fields = array( 'id', 'user_login', 'user_pass', 'user_nicename', 'user_email', 'user_url', 'user_registered', 'user_activation_key', 'user_status', 'display_name', ); if ( is_multisite() ) { $allowed_fields[] = 'spam'; $allowed_fields[] = 'deleted'; } if ( is_array( $qv['fields'] ) ) { $qv['fields'] = array_map( 'strtolower', $qv['fields'] ); $qv['fields'] = array_intersect( array_unique( $qv['fields'] ), $allowed_fields ); if ( empty( $qv['fields'] ) ) { $qv['fields'] = array( 'id' ); } $this->query_fields = array(); foreach ( $qv['fields'] as $field ) { $field = 'id' === $field ? 'ID' : sanitize_key( $field ); $this->query_fields[] = "$wpdb->users.$field"; } $this->query_fields = implode( ',', $this->query_fields ); } elseif ( 'all_with_meta' === $qv['fields'] || 'all' === $qv['fields'] || ! in_array( $qv['fields'], $allowed_fields, true ) ) { $this->query_fields = "$wpdb->users.ID"; } else { $field = 'id' === strtolower( $qv['fields'] ) ? 'ID' : sanitize_key( $qv['fields'] ); $this->query_fields = "$wpdb->users.$field"; } if ( isset( $qv['count_total'] ) && $qv['count_total'] ) { $this->query_fields = 'SQL_CALC_FOUND_ROWS ' . $this->query_fields; } $this->query_from = "FROM $wpdb->users"; $this->query_where = 'WHERE 1=1'; // Parse and sanitize 'include', for use by 'orderby' as well as 'include' below. if ( ! empty( $qv['include'] ) ) { $include = wp_parse_id_list( $qv['include'] ); } else { $include = false; } $blog_id = 0; if ( isset( $qv['blog_id'] ) ) { $blog_id = absint( $qv['blog_id'] ); }Changelog
Introduced in 5.3.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
Deprecated the 'who' parameter.from the docblock
$orderby parameter. Added multi-dimensional array syntax for $orderby parameter.from the docblockinclude value.from the docblockAbout this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/class-wp-user-query.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.