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.

Usage

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

	return $response;
}
$response(WP_REST_Response)
The response object.
$post(WP_Post)
The original attachment post.
$request(WP_REST_Request)
Request used to generate the response.

Список изменений

С версии 4.7.0 Введена.

Где вызывается хук

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

Где используется хук в ядре WP

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