How-to and Troubleshooting
3
Posts
2
Users
1
Reactions
1,323
Views
Jun 23, 2021 4:14 pm
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!
2 Replies
Jun 25, 2021 8:36 am
Please rewrite your custom code with the following function:
wpdiscuzAjaxObj.myCallback = function () { }