WordPress at Your Fingertips
function is not described

wp_get_default_extension_for_mime_type() WP 5.8.1

Returns first matched extension for the mime-type, as mapped from wp_get_mime_types().

No Hooks.

Return

String|false.

Usage

wp_get_default_extension_for_mime_type( $mime_type );
$mime_type(string) (required)
-

Changelog

Since 5.8.1 Introduced.

Code of wp_get_default_extension_for_mime_type() WP 5.8.2

function wp_get_default_extension_for_mime_type( $mime_type ) {
	$extensions = explode( '|', array_search( $mime_type, wp_get_mime_types(), true ) );

	if ( empty( $extensions[0] ) ) {
		return false;
	}

	return $extensions[0];
}