Helper function to test if each of an array of file names could conflict with existing files.
Parameters
$filenames
string[]required- Array of file names to check.
$dir
stringrequired- The directory containing the files.
$files
arrayrequired- An array of existing files in the directory. May be empty.
Source
function _wp_check_alternate_file_names( $filenames, $dir, $files ) {
foreach ( $filenames as $filename ) {
if ( file_exists( $dir . $filename ) ) {
return true;
}
if ( ! empty( $files ) && _wp_check_existing_file_names( $filename, $files ) ) {
return true;
}
}
return false;
}
Changelog
Version | Description |
---|---|
5.8.1 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.