apply_filters( 'rest_user_query', array $prepared_args, WP_REST_Request $request )
- Since
- 4.7.0
Filters WP_User_Query arguments when querying users via the REST API.
Compatibility
- WordPress
- since 4.7.0
- 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).
Parameters
$prepared_argsarray- Array of arguments for WP_User_Query.
$requestWP_REST_Request- The REST API request.
Where this hook fires · 1
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:374WP_REST_Users_Controller::get_items()
Source code
* * @since 4.7.0 * * @param array $prepared_args Array of arguments for WP_User_Query. * @param WP_REST_Request $request The REST API request. */ $prepared_args = apply_filters( 'rest_user_query', $prepared_args, $request ); $query = new WP_User_Query( $prepared_args ); if ( ! $is_head_request ) { $users = array();Changelog
Introduced in 4.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, 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.