Callbacks
Last updated
Last updated
DLX Plugins
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.
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
This callback provides no arguments.
If you'd rather use a native JS event, you can use the event: wpacBeforeSelectElements
commentUrl (string)
unapproved (boolean)
If you'd rather use a native JS event, you can use the event: wpacAfterPostComment
newDom (jQuery DOM element)
commentUrl (string)
If you'd rather use a native JS event, you can use the event: wpacBeforeUpdateComments
newDom (jQuery DOM element)
commentUrl (string)