On this page
WP_Image_Editor::get_extension( string $mime_type = null ): string|false
Returns first matched extension from Mime-type, as mapped from wp_get_mime_types()
Parameters
$mime_typestring Optional-
Default:
null
Return
string|false
Source
File: wp-includes/class-wp-image-editor.php. View all references
protected static function get_extension( $mime_type = null ) {
if ( empty( $mime_type ) ) {
return false;
}
return wp_get_default_extension_for_mime_type( $mime_type );
}
Related
Uses
| Uses | Description |
|---|---|
| wp_get_default_extension_for_mime_type() wp-includes/functions.php | Returns first matched extension for the mime-type, as mapped from wp_get_mime_types() . |
Used By
| Used By | Description |
|---|---|
| WP_Image_Editor::get_output_format() wp-includes/class-wp-image-editor.php | Returns preferred mime-type and extension based on provided file’s extension and mime, or current file’s extension and mime. |
Changelog
| Version | Description |
|---|---|
| 3.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_image_editor/get_extension