wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_wp_check_alternate_file_names › WordPress Function

Seit5.8.1
Veraltetn/v
_wp_check_alternate_file_names ( $filenames, $dir, $files )
Zugriff:
  • private
Parameter: (3)
  • (string[]) $filenames Array of file names to check.
    Erforderlich: Ja
  • (string) $dir The directory containing the files.
    Erforderlich: Ja
  • (array) $files An array of existing files in the directory. May be empty.
    Erforderlich: Ja
Gibt zurück:
  • (bool) True if the tested file name could match an existing file, false otherwise.
Definiert in:
Codex:

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



Quellcode

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