delete_post and deleted_post

A little note for myself and anyone else. I have not tested this yet but hopefully I will soon.

From my snooping, Wordpress 2.2.x has a new hook and has changed a hook. Before 2.2, the delete_post hook was called after the post was deleted. With 2.2, delete_post hook is call before the post is deleted whereas a new hook deleted_post is called after the post is deleted. In all the cases, the hook function is passed the post ID.

This is very good because originally you would be out of luck if you needed information (date, slug, etc) about the deleted post. Now you can grab the information, based upon the ID, before the post is deleted from the database.

Leave a Reply

All comments are moderated for approval after submission. Attention spammers do not waste your or my time by trying to comment.

Your Personal Information
Author Name .
Email Address .
Website Address .
Your Comment
Send Your Reply