MyBB Community Forums

Full Version: Hook to handle deleted posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

Another day, another question:

I have to handle deleted and restored posts. No problem, I used the hook editpost_delete and editpost_restore and the global variable $pid. Works greatz so far.

But that does not work if I delete or restore a whole thread. How can I hook in for that and get the deleted post-IDs to work with? Or the pids of the restored postings?

Thanks in advance!
So you want to handle posts in a deleted thread?

You will need to hook at _class_moderation_delete_thread_start_ for real thread deletion and _class_moderation_restore_threads_ for soft thread restore and _class_moderation_soft_delete_threads_ for fost thread deletion.