Delete data from custom table when deleting a post
delete_post fires when the post is deleted permanently, not when it is trashed. I don’t know if that is relevant but keep that in mind. That is the only real WordPress specific part of this question. The rest is bad PHP. Variables do not expand inside single quotes. You are a sending a query to … Read more