rest_prepare_status filter-hook . WP 4.7.0
Filters a status returned from the REST API.
Allows modification of the status data right before it is returned.
Usage
add_filter( 'rest_prepare_status', 'filter_function_name_6875', 10, 3 ); function filter_function_name_6875( $response, $status, $request ){ // filter... return $response; }
- $response(WP_REST_Response)
- The response object.
- $status(object)
- The original status object.
- $request(WP_REST_Request)
- Request used to generate the response.
Changelog
Since 4.7.0 | Introduced. |
Where the hook is called
rest_prepare_status
wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php 281
return apply_filters( 'rest_prepare_status', $response, $status, $request );