Last active
September 27, 2024 14:18
-
-
Save matty0501/c027e3fd44a9da536605c6fef45d72b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Perks // Populate Anything // LMT Extract First Letter | |
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/ | |
* | |
* 🦄 This has now been added to the Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gp-populate-anything/gppa-lmt-extract-first-character.php | |
* | |
* Extract the first letter of a string using a Live Merge Tag | |
*/ | |
// 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 ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment