filtrod 4.9.0
pre_trash_post
Opis — z kodu źródłowego
Filters whether a post trashing should take place.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$trash | bool | null | Whether to go forward with trashing. |
$post | \WP_Post | Post object. |
$previous_status | string | The status of the post about to be trashed. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_trash_post', '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_trash_post', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii