WP_Image_Editor::get_extension()protected staticWP 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.9.3

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

	return wp_get_default_extension_for_mime_type( $mime_type );
}