Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spivurno/eea345cbe4bf5d9e691330db9242f5d4 to your computer and use it in GitHub Desktop.
Save spivurno/eea345cbe4bf5d9e691330db9242f5d4 to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Custom Rename Uploaded Files
<?php
/**
* Gravity Wiz // Gravity Forms // Custom Rename Uploaded Files
* https://gravitywiz.com/rename-uploaded-files-for-gravity-form/
*
* Demonstrates how to extend the GW_Rename_Uploaded_Files class and overwrite the clean() method with your own version.
* This is the recommended method for allowing your own formats and special characters.
*/
class Custom_Rename_Uploaded_Files extends GW_Rename_Uploaded_Files {
function clean( $str ) {
return $str;
}
}
new Custom_Rename_Uploaded_Files( array(
'form_id' => 123,
'field_id' => 1,
'template' => '{form_title}-[{:3.3}]-{filename}'
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment