Skip to content

Instantly share code, notes, and snippets.

@matty0501
Created July 19, 2024 08:52
Show Gist options
  • Save matty0501/c027e3fd44a9da536605c6fef45d72b9 to your computer and use it in GitHub Desktop.
Save matty0501/c027e3fd44a9da536605c6fef45d72b9 to your computer and use it in GitHub Desktop.
<?php
/**
* Gravity Perks // Populate Anything // LMT Extract First Letter
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
*
* 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