<?php

/* Callback resource for EC Confident CAPTCHA AJAX calls
/* Requires EC Confident CAPTCHA */
require_once '../confidentcaptcha/ConfidentCaptchaClient.php';
/* Generate callback response */
if (isset($_REQUEST['endpoint'])) {
    $confidentCaptchaClient = new ConfidentCaptchaClient();
    $return = $confidentCaptchaClient->callback($_REQUEST);
    header($return[0]);
    echo $return[1];
}
 function callback_rewrite_parse_request(&$wp)
 {
     if (array_key_exists('confident_callback', $wp->query_vars)) {
         if (isset($_REQUEST['endpoint'])) {
             $confidentCaptchaClient = new ConfidentCaptchaClient();
             $return = $confidentCaptchaClient->callback($_REQUEST);
             header($return[0]);
             echo $return[1];
         }
     }
 }