On this page
apply_filters( 'wp_unique_filename', string $filename, string $ext, string $dir, callable|null $unique_filename_callback, string[] $alt_filenames, int|string $number )
Filters the result when generating a unique file name.
Parameters
$filenamestring-
Unique file name.
$extstring-
File extension. Example: ".png".
$dirstring-
Directory path.
$unique_filename_callbackcallable|null-
Callback function that generates the unique file name.
$alt_filenamesstring[]-
Array of alternate file names that were checked for collisions.
$numberint|string-
The highest number that was used to make the file name unique or an empty string if unused.
Source
File: wp-includes/functions.php. View all references
return apply_filters( 'wp_unique_filename', $filename, $ext, $dir, $unique_filename_callback, $alt_filenames, $number );
Related
Used By
| Used By | Description |
|---|---|
| wp_unique_filename() wp-includes/functions.php | Gets a filename that is sanitized and unique for the given directory. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_unique_filename