Skip to content

Commit

Permalink
gppa-lmt-extract-first-character.php: Added new snippet. (#898)
Browse files Browse the repository at this point in the history
* `gppa-lmt-extract-first-character.php`: Added new snippet.

* `gppa-lmt-extract-first-character.php`: Fixed PHPCS issues.
  • Loading branch information
matty0501 committed Sep 27, 2024
1 parent 4e263be commit f10e160
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gp-populate-anything/gppa-lmt-extract-first-character.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Gravity Perks // Populate Anything // Extract First Character From Live Merge Tag
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
*
* Extract the first character of a string using when a Live Merge Tag.
* This is useful when you need the first letter of a name, for example.
*/
// Update "123" to your form ID; and "4" to the field ID you are copying from.
add_filter( 'gppa_live_merge_tag_value_123_4', function( $value ) {
return substr( $value, 0, 1 );
} );

0 comments on commit f10e160

Please sign in to comment.