rest_user_collection_params filter-hookWP 4.7.0

Filters REST API collection parameters for the users controller.

This filter registers the collection parameter, but does not map the collection parameter to an internal WP_User_Query parameter. Use the rest_user_query to set WP_User_Query arguments.


add_filter( 'rest_user_collection_params', 'wp_kama_rest_user_collection_params_filter' );

 * Function for `rest_user_collection_params` filter-hook.
 * @param array $query_params JSON Schema-formatted collection parameters.
 * @return array
function wp_kama_rest_user_collection_params_filter( $query_params ){

	// filter...
	return $query_params;
JSON Schema-formatted collection parameters.


Since 4.7.0 Introduced.

Where the hook is called

wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php 1612
return apply_filters( 'rest_user_collection_params', $query_params );

Where the hook is used in WordPress

Usage not found.