Created
March 14, 2017 13:36
-
-
Save spivurno/fbe5cdb8f6a425c98742ff735d2231f6 to your computer and use it in GitHub Desktop.
Gravity Perks // GP Preview Submission // Display Filename for File Upload Fields
This file contains 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 // 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