Filter hook 'pre_wp_unique_filename_file_list'

in WP Core File wp-includes/functions.php at line 2667

Description

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.

Occurrences

Filename Line Number
wp-includes/functions.php 2667

Parameters

Type Name Description
array|null $files The list of files to use for filename comparisons. Default null (to retrieve the list from the filesystem).
string $dir The directory for the new file.
string $filename The proposed filename for the new file.

PHP Doc

/**
			 * 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.
			 *
			 * @since 5.5.0
			 *
			 * @param array|null $files    The list of files to use for filename comparisons.
			 *                             Default null (to retrieve the list from the filesystem).
			 * @param string     $dir      The directory for the new file.
			 * @param string     $filename The proposed filename for the new file.
			 */