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 ] );
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment