Created
June 13, 2017 13:01
-
-
Save FellowshipAgency/468b6b53e9eefd2237d24ddfd6186fef to your computer and use it in GitHub Desktop.
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: | |
add_filter( 'gform_file_upload_markup', 'change_upload_markup', 10, 4 ); | |
function change_upload_markup( $file_upload_markup, $file_info, $form_id, $field_id ) { | |
return '<strong>' . esc_html( $file_info['uploaded_filename'] ) . "</strong > <img class='gform_delete' src='" . GFCommon::get_base_url() . "/images/delete.png' onclick='gformDeleteUploadedFile({$form_id}, {$id}, this);' />"; | |
} | |
// JS: | |
gform.addFilter('gform_file_upload_markup', function (html, file, up, strings, imagesUrl) { | |
var formId = up.settings.multipart_params.form_id, | |
fieldId = up.settings.multipart_params.field_id; | |
html = '<strong>' + file.name + "</strong> <img class='gform_delete' " | |
+ "src='" + imagesUrl + "/delete.png' " | |
+ "onclick='gformDeleteUploadedFile(" + formId + "," + fieldId + ", this);' " | |
+ "alt='" + strings.delete_file + "' title='" + strings.delete_file + "' />"; | |
return html; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment