Filters the post data for a REST API response.
The dynamic portion of the hook name, $this->post_type, refers to the post type slug.
Possible hook names include:
rest_prepare_postrest_prepare_pagerest_prepare_attachment$responseWP_REST_Response
$postWP_Post
$requestWP_REST_Request
return apply_filters( "rest_prepare_{$this->post_type}", $response, $post, $request );
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/rest_prepare_this-post_type