WordPress at a glance
function is not described

WP_Image_Editor::get_mime_type() protected WP 3.5.0

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

{} It's a method of the class: WP_Image_Editor{}

No Hooks.

Return

String/false.

Usage

$result = WP_Image_Editor::get_mime_type( $extension );
$extension(string)

Default: null

Changelog

Since 3.5.0 Introduced.

Code of WP_Image_Editor::get_mime_type() WP 5.5.1

<?php
protected static function get_mime_type( $extension = null ) {
	if ( ! $extension ) {
		return false;
	}

	$mime_types = wp_get_mime_types();
	$extensions = array_keys( $mime_types );

	foreach ( $extensions as $_extension ) {
		if ( preg_match( "/{$extension}/i", $_extension ) ) {
			return $mime_types[ $_extension ];
		}
	}

	return false;
}