akcjadynamicznyod 6.6.0
deleted_post_{$post->post_type}
Args 2Plik wp-includes/post.php
Opis — z kodu źródłowego
Fires immediately after a post is deleted from the database.
The dynamic portion of the hook name, $post->post_type, refers to the post type slug.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$post_id | int | Post ID. |
$post | \WP_Post | Post object. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'deleted_post_{$post->post_type}', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'deleted_post_{$post->post_type}', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii