Filters an attachment returned from the REST API. Allows modification of the attachment right before it is returned.
$response, $post, $request
Sortie :
@param WP_REST_Response $response The response object. @param WP_Post $post The original attachment post. @param WP_REST_Request $request Request used to generate the response.
// Modifier la valeur avec le filtre 'rest_prepare_attachment'
add_filter('rest_prepare_attachment', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($response) {
// Modifier la valeur
return $response;
}
Chargement des actualités...