Is it possible to run a function every time a post is deleted. The function has to be run when the post is deleted from the admin or by the wp_delete_post() function.
Leave a Reply
You must be logged in to post a comment.
Is it possible to run a function every time a post is deleted. The function has to be run when the post is deleted from the admin or by the wp_delete_post() function.
You must be logged in to post a comment.
Yes, by adding an action to the before_delete_post, delete_post, or deleted_post actions.