<?php if ( empty( $_POST['provider'] ) ) { ?>

	<script src="https://www.google.com/recaptcha/api.js?onload=reCaptchaCallback"></script>

	<div class="field recaptcha_extra_field">

		<div class="g-recaptcha-class" data-sitekey="<?php echo $reCaptcha_api_key; ?>" id="<?php echo $identifier; ?>"></div>

	</div>

	<script>

		var identifier = '<?php echo $identifier; ?>';

		var reCaptchaCallback = function() {
			if ( jQuery( '#' + identifier ).length ) {
				try {
					var widget_id = grecaptcha.render( identifier, { 'sitekey' : wpj_vars.reCaptcha_api_key, 'callback' : 'var_' + identifier + '_callback', 'hl' : wpj_vars.language_code } );
					jQuery( '#' + identifier ).attr( 'data-widget-id', widget_id );

				} catch ( error ) {}
			}
		};

		window['var_' + identifier + '_callback'] = function( response ) {
			jQuery( '.g-recaptcha-class > div' ).removeClass( 'input error' );
			jQuery( '.ui.error.message.js-recaptcha-error' ).remove();
			jQuery( '#' + identifier + '_response' ).val( response );
		};

	</script>

<?php }