Captcha::field_markup()
Description #
Field markup.
Source #
File: addons/recaptcha/recaptcha/class-captcha.php
public function field_markup() {
parent::field_markup();
if ( ap_opt( 'recaptcha_site_key' ) === '' ) {
$this->add_html( '<div class="ap-notice red">' . __( 'Unable to render captcha. Please add reCpatcha keys in AnsPress options.', 'anspress-question-answer' ) . '</div>' );
return;
}
$this->add_html( '<div class="g-recaptcha load-recaptcha" id="' . $this->id() . '" data-sitekey="' . ap_opt( 'recaptcha_site_key' ) . '"></div>' );
$this->add_html( "<script type=\"text/javascript\" src=\"https://www.google.com/recaptcha/api.js?hl=" . get_locale() . "&onload=apCpatchaLoaded&render=explicit\"></script>" );
/** This action is documented in lib/form/class-input.php */
do_action_ref_array( 'ap_after_field_markup', [ &$this ] );
}
Expand full source code Collapse full source code View on GitHub: addons/recaptcha/recaptcha/class-captcha.php:94
Add your comment