rest_prepare_url_details filter-hookWP 5.9.0

Filters the URL data for the response.


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;
The response object.
The requested URL.
Request object.
HTTP response body from the remote URL.


Since 5.9.0 Introduced.

Where the hook is called

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 );

Where the hook is used in WordPress

Usage not found.