configure(array('privateKey' => $this->privateKey, 'captchaAction' => $this->captchaAction, 'spamAction' => $this->spamAction)); $this->setValidation($validator); } public function render() { wp_enqueue_script( 'accua-forms-recaptcha2', ACCUA_FORMS_DIR_URL . 'assets/js/frontend/recaptcha2.js', array('jquery'), ACCUA_FORMS_JS_VERSION, true ); $js_registration = _accua_forms_json_encode(array( $this->attributes["id"], array('sitekey' => $this->publicKey), $this->form->getLanguage(), )); $field_id = htmlspecialchars($this->attributes["id"], ENT_QUOTES); // No input with the element name exists in the DOM (the widget POSTs g-recaptcha-response), // so expose the name here for the error JS label/anchor fallback. $field_name = htmlspecialchars($this->attributes["name"], ENT_QUOTES); echo << EOT; } }