Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spivurno/fbe5cdb8f6a425c98742ff735d2231f6 to your computer and use it in GitHub Desktop.
Save spivurno/fbe5cdb8f6a425c98742ff735d2231f6 to your computer and use it in GitHub Desktop.
Gravity Perks // GP Preview Submission // Display Filename for File Upload Fields
<?php
/**
* Gravity Perks // GP Preview Submission // Display Filename for File Upload Fields
* http://gravitywiz.com/documentation/gravity-forms-preview-submission/
*/
add_filter( 'gpps_special_merge_tags_value_fileupload', function( $value, $field, $input_id, $modifier, $form, $entry ) {
if( ! $field->multipleFiles ) {
$input_name = 'input_' . str_replace( '.', '_', $field->id );
$file_info = GFFormsModel::get_temp_filename( $form['id'], $input_name );
$value = $file_info['uploaded_filename'];
}
return $value;
}, 10, 6 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment