I was not able to figure out in the plugin code if it's possible to use just the sanitized filename or not. I worked around the problem by creating a shortcode you can use in your notification area. Add this code to your theme's functions.php.
[php]
add_shortcode ('gf_filename', 'uploaded_file_basename');
function uploaded_file_basename( $atts, $content = null ) {
$filename = basename($content);
return $filename;
}
Use the shortcode in your notification like this:
[gf_filename]{MERGE TAG}[/gf_filename]
Wrap the merge tag from the drop down in the shortcode [gf_filename]. That will output the plain text filename as it was being used in the {all_fields} notification.
If you want to link the file to the name, exactly as it is when used in the {all_fields} notification, you can do this:
<a href="{MERGE TAG}" title="click to view">[gf_filename]{MERGE TAG}[/gf_filename]</a>
Be sure to use the drop down for your actual merge tag, to replace {MERGE TAG} in this example. Please let me know if you have any questions about that.
For reference, I put the code online here as well:
http://pastebin.com/Ta4WeEwv
Posted 12 years ago on Friday August 3, 2012 |
Permalink