Created
August 20, 2016 04:28
-
-
Save spivurno/eea345cbe4bf5d9e691330db9242f5d4 to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Custom Rename Uploaded Files
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 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