wp_get_default_extension_for_mime_type( string $mime_type )
Returns first matched extension for the mime-type, as mapped from wp_get_mime_types().
Parameters
- $mime_type
-
(string) (Required)
Return
(string|false)
Source
File: wp-includes/functions.php
function wp_get_default_extension_for_mime_type( $mime_type ) { $extensions = explode( '|', array_search( $mime_type, wp_get_mime_types(), true ) ); if ( empty( $extensions[0] ) ) { return false; } return $extensions[0]; }
Expand full source code Collapse full source code View on Trac View on GitHub
Changelog
Version | Description |
---|---|
5.8.1 | Introduced. |