after_delete_post хук-событиеWP 3.2.0

Использование

add_action( 'after_delete_post', 'wp_kama_after_delete_post_action', 10, 2 );

/**
 * Function for `after_delete_post` action-hook.
 * 
 * @param int     $postid Post ID.
 * @param WP_Post $post   Post object.
 *
 * @return void
 */
function wp_kama_after_delete_post_action( $postid, $post ){

	// action...
}
$postid(int)
Post ID.
$post(WP_Post)
Post object.

Список изменений

С версии 3.2.0 Введена.
С версии 5.5.0 Added the $post parameter.

Где вызывается хук

wp_delete_post()
after_delete_post
wp-includes/post.php 3482
do_action( 'after_delete_post', $postid, $post );

Где используется хук в WordPress

wp-includes/ms-default-filters.php 79
add_action( 'after_delete_post', '_update_posts_count_on_delete' );