Edu-pumkin II – The Bava
I had to make a hole in the back of Jim’s head to let some of the hot air out. Still needs some work though as the candle keeps going out.
1 You should see what Santa looks like in our house.
This may be one of those things that everyone knows but it was new to me. I’m also duplicating the information I found in the StackOverflow post because I think it’s good to have information in multiple places where it might be found by other people. Additionally, writing the post makes it easy for me to find later when I forget and the act of writing the post helps get it stuck in my own head. With all of that as the lead up . . . A common way to trigger events in WordPress is the save_post action. It runs any time the post is created, published, or updated. What I found out though was that it also runs when you try to delete the post. That makes sense. It is an update and it’s no big deal if the function is relatively small and/or if you’re not trying to get rid of a ton of posts. My current experiment had both a fairly involved function and a couple hundred posts I wanted deleted. Luckily, I found this post on StackOverflow. Now I can set a simple check at the beginning of the function that looks to make sure it’s the right post type (site) and it’s a trashed post. In either of those cases the function gets skipped.