wpseek.com
WordPress开发者和主题制作者的搜索引擎



_wp_check_alternate_file_names › WordPress Function

Since5.8.1
已弃用n/a
_wp_check_alternate_file_names ( $filenames, $dir, $files )
访问:
  • private
参数: (3)
  • (string[]) $filenames Array of file names to check.
    Required: Yes
  • (string) $dir The directory containing the files.
    Required: Yes
  • (array) $files An array of existing files in the directory. May be empty.
    Required: Yes
返回:
  • (bool) True if the tested file name could match an existing file, false otherwise.
定义在:
文档:

Helper function to test if each of an array of file names could conflict with existing files.



源码

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;
}