after_delete_post action-hookWP 3.2.0

Fires after a post is deleted, at the conclusion of wp_delete_post().

Usage

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

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

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

Changelog

Since 3.2.0 Introduced.
Since 5.5.0 Added the $post parameter.

Where the hook is called

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

Where the hook is used in WordPress

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