wp_get_default_extension_for_mime_type( string $mime_type ): string|false

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


Parameters

$mime_type string Required

Top ↑

Return

string|false


Top ↑

Source

File: wp-includes/functions.php. View all references

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


Top ↑

Changelog

Changelog
Version Description
5.8.1 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.