spivurno
8/20/2016 - 4:28 AM

Gravity Wiz // Gravity Forms // Custom Rename Uploaded Files

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}'
) );