reCAPTCHA::render_output( awsmug\Torro_Forms\DB_Objects\Forms\Form $form )

Renders the output for the protector before the Submit button.

Description

See also

Parameters

$form

(awsmug\Torro_Forms\DB_Objects\Forms\Form) (Required) Form object.

Source

File: src/modules/protectors/recaptcha.php

	public function render_output( $form ) {
		if ( ! $this->is_configured() ) {
			?>
			<div class="torro-notice torro-error-notice">
				<p><?php _e( 'You should actually be able to see a reCAPTCHA field here, but it is not correctly configured. Please contact an administrator.', 'torro-forms' ); ?></p>
			</div>
			<?php
			return;
		}

		$key   = $this->get_option( 'site_key' );
		$type  = $this->get_form_option( $form->id, 'type', 'image' );
		$size  = $this->get_form_option( $form->id, 'size', 'normal' );
		$theme = $this->get_form_option( $form->id, 'theme', 'light' );

		?>
		<div class="torro-recaptcha torro-element-wrap">
			<div id="<?php echo esc_attr( 'recaptcha-placeholder-' . $form->id ); ?>" class="torro-recaptcha-placeholder" data-form-id="<?php echo absint( $form->id ); ?>" data-sitekey="<?php echo esc_attr( $key ); ?>" data-type="<?php echo esc_attr( $type ); ?>" data-size="<?php echo esc_attr( $size ); ?>" data-theme="<?php echo esc_attr( $theme ); ?>"></div>
		</div>
		<?php

		if ( ! $this->script_hooked ) {
			$this->script_hooked = true;
			add_action( 'wp_footer', array( $this, 'print_script' ), 10, 0 );
		}
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.