wp_get_default_extension_for_mime_type() – Returns first matched extension for the mime-type, as mapped from wp_get_mime_types().

You appear to be a bot. Output may be restricted

Description

Returns first matched extension for the mime-type, as mapped from wp_get_mime_types().

Usage

$string|false = wp_get_default_extension_for_mime_type( $mime_type );

Parameters

$mime_type
( string ) required

Returns

string|false

Source

File name: wordpress/wp-includes/functions.php
Lines:

1 to 9 of 9
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];
}
 

 View on GitHub View on Trac