WordPress at Your Fingertips
filter is not described

pre_wp_unique_filename_file_list filter-hook . WP 5.5.0

Filters the file list used for calculating a unique filename for a newly added file.

Returning an array from the filter will effectively short-circuit retrieval from the filesystem and return the passed value instead.


add_filter( 'pre_wp_unique_filename_file_list', 'filter_function_name_2893', 10, 3 );
function filter_function_name_2893( $files, $dir, $filename ){
	// filter...

	return $files;
The list of files to use for filename comparisons.
Default: null (to retrieve the list from the filesystem)
The directory for the new file.
The proposed filename for the new file.

Where the hook is called

wp-includes/functions.php 2586
$files = apply_filters( 'pre_wp_unique_filename_file_list', null, $dir, $filename );

Where in WP core the hook is used WordPress

Usage not found.