WordPress at Your Fingertips
filter is not described

wp_unique_filename filter-hook . WP 4.5.0

Filters the result when generating a unique file name.


add_filter( 'wp_unique_filename', 'filter_function_name_3707', 10, 6 );
function filter_function_name_3707( $filename, $ext, $dir, $unique_filename_callback, $alt_filenames, $number ){
	// filter...

	return $filename;
Unique file name.
File extension, eg. ".png".
Directory path.
Callback function that generates the unique file name.
Array of alternate file names that were checked for collisions.
The highest number that was used to make the file name unique or an empty string if unused.


Since 5.8.1 The $alt_filenames and $number parameters were added.

Where the hook is called

wp-includes/functions.php 2690
return apply_filters( 'wp_unique_filename', $filename, $ext, $dir, $unique_filename_callback, $alt_filenames, $number );

Where in WP core the hook is used WordPress

Usage not found.