WordPress AdminAjax Route
< 1 min read
add_action( 'wp_ajax_question_set_answer', 'ajax_question_set_answer'); add_action( 'wp_ajax_nopriv_question_set_answer', 'ajax_question_set_answer'); function ajax_question_set_answer(){ $question = $_REQUEST["question"]; $val = $_REQUEST["value"]; echo json_encode([ 'status' => 'ok' ]); wp_die(); }
Powered by BetterDocs