_wp_check_alternate_file_names()
Helper function to test if each of an array of file names could conflict with existing files.
Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.
Хуков нет.
Возвращает
bool. True if the tested file name could match an existing file, false otherwise.
Использование
_wp_check_alternate_file_names( $filenames, $dir, $files );
- $filenames(string[]) (обязательный)
- Array of file names to check.
- $dir(строка) (обязательный)
- The directory containing the files.
- $files(массив) (обязательный)
- An array of existing files in the directory. May be empty.
Список изменений
| С версии 5.8.1 | Введена. |
Код _wp_check_alternate_file_names() wp check alternate file names WP 7.1.4
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;
}