Skip to content

Instantly share code, notes, and snippets.

@jorpdesigns
Created July 14, 2021 19:53
Show Gist options
  • Save jorpdesigns/39e48d592c7f1874eda57a152eecc1e6 to your computer and use it in GitHub Desktop.
Save jorpdesigns/39e48d592c7f1874eda57a152eecc1e6 to your computer and use it in GitHub Desktop.
Snippet to show custom value for Gravity Forms field on entry page
<?php
add_filter( 'gform_entry_field_value', function ( $value, $field, $entry, $form ) {
if ( '10' == $field->id && '4' == $form['id'] ) { // Replace 10 with your field id & 4 with your form id
$value = 'Custom Value';
}
return $value;
}, 10, 4 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment