filtrod 5.5.0
pre_delete_attachment
Opis — z kodu źródłowego
Filters whether an attachment deletion should take place.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$delete | \WP_Post | false | null | Whether to go forward with deletion. |
$post | \WP_Post | Post object. |
$force_delete | bool | Whether to bypass the Trash. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_delete_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( 'pre_delete_attachment', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii