filtrod 4.7.0
rest_prepare_attachment
Opis — z kodu źródłowego
Filters an attachment returned from the REST API.
Allows modification of the attachment right before it is returned.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$response | \WP_REST_Response | The response object. |
$post | \WP_Post | The original attachment post. |
$request | \WP_REST_Request | Request used to generate the response. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_prepare_attachment', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_prepare_attachment', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii