rest_prepare_url_details
Filters the URL data for the response.
Usage
add_filter( 'rest_prepare_url_details', 'wp_kama_rest_prepare_url_details_filter', 10, 4 ); /** * Function for `rest_prepare_url_details` filter-hook. * * @param WP_REST_Response $response The response object. * @param string $url The requested URL. * @param WP_REST_Request $request Request object. * @param string $remote_url_response HTTP response body from the remote URL. * * @return WP_REST_Response */ function wp_kama_rest_prepare_url_details_filter( $response, $url, $request, $remote_url_response ){ // filter... return $response; }
- $response(WP_REST_Response)
- The response object.
- $url(string)
- The requested URL.
- $request(WP_REST_Request)
- Request object.
- $remote_url_response(string)
- HTTP response body from the remote URL.
Changelog
Since 5.9.0 | Introduced. |
Where the hook is called
rest_prepare_url_details
wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php 187
return apply_filters( 'rest_prepare_url_details', $response, $url, $request, $remote_url_response );