I am working on creating a custom plugin in WordPress. I have created a settings page for the plugin by using add_menu_page() function and settings Api functions like add_settings_section, add_settings_field,register_settings.
I want to use ajax on the submit_button() in the settings page, so that I can match the settings being saved by some specific value before saving.
I am using wp_ajax action hook for this.
All the code I have checked from WordPress codex and is fine.
The wp_ajax_action hook is not working but, the function is not being called or hooked.
I have tried by placing the action for wp_ajax_action on the construct fxn of plugin’s file but its not working.
Please tell me how to do this.

Read more here: Not able to use wp_ajax_action hook for running a custom function in the settings page of a custom plugin on click of submit_button()


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: