Skip to content

Instantly share code, notes, and snippets.

@New0
Last active January 2, 2023 13:59
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 New0/050c055515c2d48ed0c3c502612d00b5 to your computer and use it in GitHub Desktop.
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
<?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