How do I call an action hook into wp_ajax hook callback function
The problem you are having is that the add_action function will only affect the current request, which in this case is your Ajax call. Afterwards, when you submit the form, that is a different request, the action is no longer present. To achieve what you want, you have to have some way of modifying the … Read more