WP_Image_Editor::get_extension( string $mime_type = null )
Returns first matched extension from Mime-type, as mapped from wp_get_mime_types()
Parameters
- $mime_type
-
(Optional)
Default value: null
Return
(string|false)
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() ) );
if ( empty( $extensions[0] ) )
return false;
return $extensions[0];
}
Changelog
Version | Description |
---|---|
WP-3.5.0 | Introduced. |