Last active
January 2, 2023 13:59
-
-
Save New0/050c055515c2d48ed0c3c502612d00b5 to your computer and use it in GitHub Desktop.
Remove random timestamp of the name of files loaded to Dropbox or Google Drive via Ninja Forms Uploads
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 | |
/* | |
* Plugin Name: NF custom code | |
* Author: New0 | |
* Description: Insert hooks to modify Ninja Forms defaults. | |
*/ | |
//Way to remove the random timestamp from filenames loaded toservices listed in the variable array | |
$services = ["dropbox", "google"]; | |
foreach($services as $service) { | |
add_filter( 'ninja_forms_uploads_' . $service . '_filename', function($filename, $original_name){ | |
return $original_name; | |
}, 10, 2 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment