wp_get_default_extension_for_mime_type( string $mime_type )

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

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.