Title: Ajax action hook overloading
Last modified: August 30, 2016

---

# Ajax action hook overloading

 *  [Looic](https://wordpress.org/support/users/looic/)
 * (@looic)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/ajax-action-hook-overloading/)
 * 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)

 *  [codemovement.pk](https://wordpress.org/support/users/codemovementpk/)
 * (@codemovementpk)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/ajax-action-hook-overloading/#post-6821075)
 * To add AJAX callbacks to a plugin please see AJAX in Plugins. [ Ajax in Plugins ](https://codex.wordpress.org/AJAX_in_Plugins)
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/ajax-action-hook-overloading/#post-6821093)
 * 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.

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 3 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/ajax-action-hook-overloading/#post-6821093)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
