wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_ext2type › WordPress Function

Da2.5.0
Deprecaton/a
› wp_ext2type ( $ext )
Parametri:
  • (string) $ext The extension to search.
    Richiesto: Sì
Ritorna:
  • (string|null) The file type, example: audio, video, document, spreadsheet, etc.
Definito a:
Codex:

Retrieves the file type based on the extension name.



Sorgenti

function wp_ext2type( $ext ) {
	$ext = strtolower( $ext );

	$ext2type = wp_get_ext_types();

	return array_find_key(
		$ext2type,
		fn( $exts ) => in_array( $ext, $exts, true )
	);
}