Callbacks
Callbacks allow you to run custom JavaScript code in certain parts of execution. For example, if you have an Edit Comments plugin, you can run a custom function that initializes the plugin after a comment has been posted.
Each callback can pass arguments, which are documented below and will be in scope for any custom JS functionality that needs to run.
A common use-case of callbacks is another plugin that needs to run before, during, and after Ajaxify Comments loads.
OnBeforeSelectElements Callback
This allows you to run JavaScript code before Ajaxify Comments has selected the DOM elements.
One argument is in scope, which is a jQuery representation of the DOM elements selected.
If you'd rather use a native JS event, you can use the event: wpacBeforeSelectElements
OnBeforeSubmitComment Callback
This callback provides no arguments.
If you'd rather use a native JS event, you can use the event: wpacBeforeSelectElements
OnAfterPostComment Callback
Arguments:
commentUrl (string)
unapproved (boolean)
If you'd rather use a native JS event, you can use the event: wpacAfterPostComment
OnBeforeUpdateComments Callback
Arguments
newDom (jQuery DOM element)
commentUrl (string)
If you'd rather use a native JS event, you can use the event: wpacBeforeUpdateComments
OnAfterUpdateComments Callback
Arguments
newDom (jQuery DOM element)
commentUrl (string)
Last updated