pre_wp_unique_filename_file_list WordPress Filter Hook

This hook is called before WordPress generates a unique filename for a file. It is called on both single and multi-file uploads.

apply_filters( 'pre_wp_unique_filename_file_list', array|null $files, string $dir, string $filename ) #

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


Description

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


Top ↑

Parameters

$files

(array|null)The list of files to use for filename comparisons. Default null (to retrieve the list from the filesystem).

$dir

(string)The directory for the new file.

$filename

(string)The proposed filename for the new file.


Top ↑

Source

File: wp-includes/functions.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More