Skip to content

Commit f10e160

Browse files
authored
gppa-lmt-extract-first-character.php: Added new snippet. (#898)
* `gppa-lmt-extract-first-character.php`: Added new snippet. * `gppa-lmt-extract-first-character.php`: Fixed PHPCS issues.
1 parent 4e263be commit f10e160

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 Perks // Populate Anything // Extract First Character From Live Merge Tag
4+
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
5+
*
6+
* Extract the first character of a string using when a Live Merge Tag.
7+
* This is useful when you need the first letter of a name, for example.
8+
*/
9+
// Update "123" to your form ID; and "4" to the field ID you are copying from.
10+
add_filter( 'gppa_live_merge_tag_value_123_4', function( $value ) {
11+
return substr( $value, 0, 1 );
12+
} );

0 commit comments

Comments
 (0)