Fires immediately before a post is deleted from the database.
Parameters
$post_id
int- Post ID.
$post
WP_Post- Post object.
Source
do_action( 'delete_post', $post_id, $post );
Fires immediately before a post is deleted from the database.
$post_id
int$post
WP_Postdo_action( 'delete_post', $post_id, $post );
You must log in before being able to contribute a note or feedback.
Let’s suppose you have a plugin that, for one reason or another, stores its own post metadata in a separate database table called codex_postmeta. One of the ways you can achieve synchronization is to be made aware when a post is deleted so that you can replicate the changes yourself.