Skip to content

Commit b51834a

Browse files
authored
Create gw-compact-recaptcha.php
1 parent 69d3ace commit b51834a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
/**
3+
* Gravity Wiz // Gravity Forms // Update reCAPTCHA widget to use "compact" mode.
4+
* https://gravitywiz.com/
5+
*/
6+
// Update "123" to your form ID and "4" to your reCAPTCHA field ID.
7+
add_filter( 'gform_field_content_123_4', function( $field_content ) {
8+
$search = 'data-theme=';
9+
$replace = sprintf( 'data-size=\'compact\' \0', $field_content );
10+
$field_content = preg_replace( "/$search/", $replace, $field_content, 1 );
11+
return $field_content;
12+
} );

0 commit comments

Comments
 (0)