WordPress at Your Fingertips
filter is not described

rest_prepare_post_type filter-hook . WP 4.7.0

Filters a post type returned from the REST API.

Allows modification of the post type data right before it is returned.


add_filter( 'rest_prepare_post_type', 'filter_function_name_6391', 10, 3 );
function filter_function_name_6391( $response, $post_type, $request ){
	// filter...

	return $response;
The response object.
The original post type object.
Request used to generate the response.


Since 4.7.0 Introduced.

Where the hook is called

wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php 254
return apply_filters( 'rest_prepare_post_type', $response, $post_type, $request );

Where in WP core the hook is used WordPress

Usage not found.