Can Ajax Action [add_action(‘wp_ajax_{action_name}’, ‘{action_name}’] be hooked into wp hook

Apparently not! My design goal was to automate the creation of related objects while performing ajax options. However, I have modified it to automate the same task differently.

  • Now all ajax functions in my classes are static.
  • JavaScript captures the class name and function name where the ajax processing will happen (as these are provided as JavaScript variables programmatically) and send the same with ajax post/get.
  • Get/Post data gets captured by a universal ajax processor and determines which class::function to call.

So, considering this, all I have to do is create just one ajax_action hook for my universal ajax processor.