@@ -166,10 +166,11 @@ public function __construct( $attributes ) {
166
166
* @return string|bool|void
167
167
*/
168
168
public function markup () {
169
+ $ container_hidden_class = 'g-recaptcha ' === $ this ->captcha_security_type && ( 'v3-reCAPTCHA ' === $ this ->recaptcha_version || 'v2-invisible ' === $ this ->recaptcha_version ) ? 'srfm-display-none ' : '' ;
169
170
ob_start (); ?>
170
171
<?php if ( ! $ this ->is_page_break ) { ?>
171
172
<?php if ( $ this ->captcha_security_type && 'none ' !== $ this ->captcha_security_type ) { ?>
172
- <div class="srfm-captcha-container <?php echo esc_attr ( ' v3-reCAPTCHA ' === $ this -> recaptcha_version || ' v2-invisible ' === $ this -> recaptcha_version ? ' srfm-display-none ' : '' ); ?> ">
173
+ <div class="srfm-captcha-container <?php echo esc_attr ( $ container_hidden_class ); ?> ">
173
174
<?php if ( 'g-recaptcha ' === $ this ->captcha_security_type && 'v2-checkbox ' === $ this ->recaptcha_version ) { ?>
174
175
<?php echo "<div class='g-recaptcha' data-callback='onSuccess' data-error-callback='onGCaptchaV2CheckBoxError' recaptcha-type=' " . esc_attr ( $ this ->recaptcha_version ) . "' data-sitekey=' " . esc_attr ( strval ( $ this ->google_captcha_site_key ) ) . "'></div> " ; ?>
175
176
<?php } ?>
@@ -228,8 +229,16 @@ public function markup() {
228
229
}
229
230
}
230
231
$ srfm_custom_button_classes = apply_filters ( 'srfm_add_button_classes ' , [ 'v2-invisible ' === $ this ->recaptcha_version || 'v3-reCAPTCHA ' === $ this ->recaptcha_version ? 'g-recaptcha ' : '' , '1 ' === $ this ->btn_from_theme ? 'wp-block-button__link ' : 'srfm-button srfm-submit-button srfm-btn-frontend srfm-custom-button ' ], $ this ->form_id );
232
+
233
+ $ button_style = $ this ->btn_from_theme ? '' : ' font-family: inherit; font-weight: var(--wp--custom--font-weight--medium); line-height: normal; ' ;
234
+ $ button_style .= 'width:100%; ' ;
235
+
236
+ $ button_attributes = '' ;
237
+ if ( 'g-recaptcha ' === $ this ->captcha_security_type && ( 'v2-invisible ' === $ this ->recaptcha_version || 'v3-reCAPTCHA ' === $ this ->recaptcha_version ) ) {
238
+ $ button_attributes = 'recaptcha-type= ' . $ this ->recaptcha_version . ' data-sitekey= ' . $ this ->google_captcha_site_key . ' data-callback="recaptchaCallback" ' ;
239
+ }
231
240
?>
232
- <button style="<?php echo $ this -> btn_from_theme ? '' : ' font-family: inherit; font-weight: var(--wp--custom--font-weight--medium ); line-height: normal; ' ; ?> width:100%; " id="srfm-submit-btn" class="<?php echo esc_attr ( Helper::join_strings ( $ srfm_custom_button_classes ) ); ?> " <?php echo ' v2-invisible ' === $ this -> recaptcha_version || ' v3-reCAPTCHA ' === $ this -> recaptcha_version ? esc_attr ( ' recaptcha-type= ' . $ this -> recaptcha_version . ' data-sitekey= ' . $ this -> google_captcha_site_key ) . ' data-callback="recaptchaCallback" ' : '' ; ?> >
241
+ <button style="<?php echo esc_attr ( $ button_style ); ?> " id="srfm-submit-btn" class="<?php echo esc_attr ( Helper::join_strings ( $ srfm_custom_button_classes ) ); ?> " <?php echo esc_attr ( $ button_attributes ) ; ?> >
233
242
<div class="srfm-submit-wrap">
234
243
<?php echo esc_html ( $ this ->button_text ); ?>
235
244
<div class="srfm-loader"></div>
0 commit comments