Jump to content

Adding a hook to fire after a forum post has been posted

Featured Replies

Posted

Hi all,

I'm working on a migration from IPB3 to 4, and a lot things have changed.

I'm struggling to work out where the most appropriate place to add a post-post hook is (yes, I'm aware of the awkward overloaded language).

I tried following the code from the API implementation, but that quickly diverted me ff down to the database layer or the generic comment classes, so I'm a bit confused.

Any pointers would be greatly appreciated.

Thanks,

Chris

Extend \IPS\forums\Topic\Post and overload the postCreate() method.

public function postCreate()
{
	/* Let the parent do its thing first */
	parent::postCreate();

	/* Then do your stuff here */

}

 

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.