Skip to content

Instantly share code, notes, and snippets.

Created November 1, 2017 15:15
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 anonymous/d6235efc3cea92e57cce6ae8b50b97bf to your computer and use it in GitHub Desktop.
Save anonymous/d6235efc3cea92e57cce6ae8b50b97bf to your computer and use it in GitHub Desktop.
<?php
add_filter(
'wp_unique_filename',
function ($filename, $ext, $dir) {
if ($dir === get_temp_dir()) {
return hash('sha256', $filename);
}
return $filename;
},
10, 3
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment