WP_Image_Editor::get_extension()protected staticWP 3.5.0

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

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.

WP_Image_Editor::get_extension() code WP 6.6.2

protected static function get_extension( $mime_type = null ) {
	if ( empty( $mime_type ) ) {
		return false;
	}

	return wp_get_default_extension_for_mime_type( $mime_type );
}