wpDiscuz - WordPress Comment Plugin
Custom callback aft...
 
Share:
Notifications
Clear all

[Solved] Custom callback after adding a comment

3 Posts
2 Users
1 Likes
616 Views
curiousjake
Posts: 2
Topic starter
(@curiousjake)
New Member
Joined: 1 year 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: 5451
 Asti
Support
(@asti)
Illustrious Member
Joined: 5 years ago

Please rewrite your custom code with the following function: 

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

New Member
Posts: 2

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

Share: