WordPress at a glance
filter is not described

rest_prepare_attachment filter-hook . WP 4.7.0

Filters an attachment returned from the REST API.

Allows modification of the attachment right before it is returned.


add_filter( 'rest_prepare_attachment', 'filter_function_name_718', 10, 3 );
function filter_function_name_718( $response, $post, $request ){
	// filter...

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

Where the hook is called

wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php 409
return apply_filters( 'rest_prepare_attachment', $response, $post, $request );

Where the hook is used (in WP core)

Использование не найдено.