• Hello All,

    I use a plugin that performs AJAX checks against for form fields validation. I would like to add my own checks to the existing ones.

    Is there a way to do “overloading” against the ‘wp_ajax_nopriv_’ action hook, so that I can add my own checks in addition to those performed by the plugin, and without modifying the original plugin code ?

    Thank you for your help,
    Looic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • To add AJAX callbacks to a plugin please see AJAX in Plugins. Ajax in Plugins

    Moderator bcworkz

    (@bcworkz)

    As codemovement has hinted, you just add your own action callback to the same action the plugin is using. You can control whether it runs before or after the plugin callback with the priority parameter. Of course you cannot return any result to indicate if your checks failed or not, and the plugin knows nothing of your efforts, so effecting meaningful results can be tricky.

    I believe if you directly manipulate the $_POST or $_GET values passed you may possibly be able to indirectly affect the plugin by placing a value that is sure to fail (or pass). Untested.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ajax action hook overloading’ is closed to new replies.