WP_Image_Editor::get_extension

Advertisement

Summery Summery

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

Syntax Syntax

WP_Image_Editor::get_extension( string $mime_type = null )

Parameters Parameters

$mime_type

(Optional)

Default value: null

Return Return

(string|false)

Source Source

File: wp-includes/class-wp-image-editor.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];
	}

Advertisement

Changelog Changelog

Changelog
Version Description
3.5.0 Introduced.

Advertisement

Leave a Reply