diff --git a/functions.php b/functions.php index bee98af..a9900c0 100644 --- a/functions.php +++ b/functions.php @@ -321,7 +321,8 @@ add_action( 'wp_ajax_quiztech_get_question', 'quiztech_ajax_get_question' ); * AJAX handler for saving (creating or updating) a question. */ function quiztech_ajax_save_question() { - check_ajax_referer( 'quiztech_save_question_action', 'nonce' ); + // Verify nonce using the correct field name from wp_nonce_field() + check_ajax_referer( 'quiztech_save_question_action', 'quiztech_question_nonce' ); if ( ! current_user_can( 'edit_questions' ) ) { wp_send_json_error( [ 'message' => esc_html__( 'Insufficient permissions.', 'quiztech' ) ], 403 );