wpDiscuz - WordPress Comment Plugin
Share:
Notifications
Clear all

[Solved] Custom callback after adding a comment


curiousjake
Posts: 2
Topic starter
(@curiousjake)
New Member
Joined: 4 months ago

Hi,

I'm trying to use the 'wpdiscuz_comment_post' filter to register a custom callback after a comment is posted, but I'm getting an error saying 'myCallback is not a function'. Digging into the source code, it seems like the runCallbacks function actually looks for the callback in the wpdiscuzAjaxObj array.

Any ideas how I can register a callback in JS that can be run after a comment is posted?

Thanks in advance!

Topic Tags
2 Replies
Asti
Posts: 3622
 Asti
Support
(@asti)
Support member
Joined: 4 years ago

Please rewrite your custom code with the following function: 

wpdiscuzAjaxObj.myCallback = function () {
}
1 Reply
curiousjake
(@curiousjake)
Joined: 4 months ago

New Member
Posts: 2

@asti Perfect, this has fixed the problem. Thanks!

Share: