Also I've added the delete button back at the bottom of the page as a test and it works. What you can do is to setup a sample post on your end with a few children and test to see if you get it to work as well.
I created a parent post and some children posts and tried to delete them with the delete button on the parent edit form, but the children are still there. So it's not working for me.
Hello Shane, I use a delete button on the edit form for the person. The delete button on the post it self is working and is deleting the child posts.
So at the top of the post there is a button Bewerken to edit the person. At the bottom of this form is the delete button I want to use. This one has exactly the same shortcode and parameters but is only removing the parent, not the children.
From my previous post I mentioned that I had to change the action from trashing the post to delete the post.
Currently on the form you have this.
action='trash'
However what is required is action='delete'. The hook "before_delete_post" doesn't work for when a post is being trashed. This hook only fires when the post is deleted directly.
Changing your action to delete should solve the issue.
Please let me know if this clarifies the issue for you.
Only the deleting of the posts will fire the hook so that you can delete the child posts as well. This is a limitation of wordpress and not our plugins themselves since we are piggy backing on their hook to get this done.
SO the only way to get this to work is to delete the posts rather than trashing them.