Fires immediately before a post is deleted from the database.
Parameters
$post_id
int- Post ID.
$post
WP_Post- Post object.
Source
// Use wp_delete_post (via wp_delete_post_revision) again. Ensures any meta/misplaced data gets cleaned up.
Fires immediately before a post is deleted from the database.
$post_id
int$post
WP_Post// Use wp_delete_post (via wp_delete_post_revision) again. Ensures any meta/misplaced data gets cleaned up.
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.