WordPress at a glance
function is not described

WP_Image_Editor::get_extension() protected WP 3.5.0

Returns first matched extension from Mime-type, 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_extension( $mime_type );
$mime_type(string)

Default: null

Changelog

Since 3.5.0 Introduced.

Code of WP_Image_Editor::get_extension() WP 5.5.1

<?php
protected static function get_extension( $mime_type = null ) {
	$extensions = explode( '|', array_search( $mime_type, wp_get_mime_types(), true ) );

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

	return $extensions[0];
}