akcjaod 4.7.0
rest_insert_attachment
Opis — z kodu źródłowego
Fires after a single attachment is created or updated via the REST API.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$attachment | \WP_Post | Inserted or updated attachment object. |
$request | \WP_REST_Request | The request sent to the API. |
$creating | bool | True when creating an attachment, false when updating. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'rest_insert_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_action( 'rest_insert_attachment', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii