WordPress at Your Fingertips
filter is not described

rest_(post_type)_collection_params filter-hook . WP 4.7.0

Filters collection parameters for the posts controller.

The dynamic part of the filter $this->post_type refers to the post type slug for the controller.

This filter registers the collection parameter, but does not map the collection parameter to an internal WP_Query parameter. Use the rest_{$this->post_type}_query filter to set WP_Query parameters.


add_filter( 'rest_(post_type)_collection_params', 'filter_function_name_9347', 10, 2 );
function filter_function_name_9347( $query_params, $post_type ){
	// filter...

	return $query_params;
JSON Schema-formatted collection parameters.
Post type object.


Since 4.7.0 Introduced.

Where the hook is called

wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 2869
return apply_filters( "rest_{$this->post_type}_collection_params", $query_params, $post_type );

Where in WP core the hook is used WordPress

Usage not found.