Fires immediately before a post is deleted from the database.
$post_idint
$postWP_Post
Take note, by the time the hook triggers, the post comments and metadata would have already been deleted. Use the before_delete_post hook to catch post deletion before that.
do_action( 'delete_post', $post_id, $post );
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/delete_post