Untitled Snippet
add_action(‘wp_ajax_tssh_send_results’, ‘tssh_send_results’); add_action(‘wp_ajax_nopriv_tssh_send_results’, ‘tssh_send_results’); function tssh_send_results() { $nonce = isset($_POST[‘nonce’]) ? sanitize_text_field($_POST[‘nonce’]) : ”; if (!wp_verify_nonce($nonce, ‘tssh_quiz_nonce’)) { wp_send_json_error(‘Security check failed. Please refresh and try again.’); } $email = isset($_POST[’email’]) ? sanitize_email($_POST[’email’]) : ”; if (!$email || !is_email($email)) { wp_send_json_error(‘Please…Continue reading