gw-gravity-forms-rename-uploaded-files-usage.php

Code

Filename: gw-gravity-forms-rename-uploaded-files-usage.php

<?php

# First and Last Name
new GW_Rename_Uploaded_Files( array(
	'form_id'  => 628,
	'field_id' => 3,
	'template' => '{Name (First):1.3}-{Name (Last):1.6}-{filename}', // most merge tags are supported, original file extension is preserved
) );

# Form Title Merge Tag
new GW_Rename_Uploaded_Files( array(
	'form_id'  => 12,
	'field_id' => 18,
	'template' => '{form_title}-{filename}', // most merge tags are supported, original file extension is preserved
) );

# Static File Name
new GW_Rename_Uploaded_Files( array(
	'form_id'  => 628,
	'field_id' => 5,
	'template' => 'static-file-name',
) );

# Static File Name and increment regardless of extension
# e.g. static-file-name.jpg static-file-name1.png static-file-name3.pdf, etc.
new GW_Rename_Uploaded_Files( array(
	'form_id'          => 628,
	'field_id'         => 5,
	'template'         => 'static-file-name',
	'ignore_extension' => true,
) );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.