The function wp_delete_post() will permanently delete when used on Custom Post Types. The
force flag only works on
See this post as an explanation of how the force flag is being used: wp_delete_post() deletes post instead of moving it to trash
Question: A plugin I have is using this function, and I want to try hook in to wp_delete_post and move the item to trash instead of permanently deleting.
Is it possible to use
before_delete_post to try move things to the trash before it reaches the stage of permanently deleting?
Alternative: Don't have the item deleted at all. In my case I would be happy to update the post status or some meta key and then I'll run a permanent delete on those products with that meta key at a later date.
My attempt so far - this test is simply to try see if I can prevent the full wp_post_delete from running. This did not work, the post was permanently deleted still.