Ajax does not trigger the action
-
Hello!
I have followed your tutorial on making an ajax “report a bug” and then I modify it to test by trigger the action.
If I use the static form in the example, the action did trigger with the action “admin_post_report_a_bug” and “admin_post_nopriv_report_a_bug”.But the action seems not being triggered when calling by action “wp_ajax_nopriv_report_a_bug” and “wp_ajax_report_a_bug”.
I have confirmed the function is being called successfully in both static form or ajax form. Only that
do_action( 'report_a_bug', $_POST['post_id'], $_POST['message'] );
does not seems to trigger in ajax situation. Is there any ordering related consideration?https://www.smashingmagazine.com/2018/07/wordpress-notifications-made-easy/
Many thanks.
The topic ‘Ajax does not trigger the action’ is closed to new replies.