gde_upload_mimes

Add upload support for natively unsupported mimetypes used by this plugin.

Description

(array) gde_upload_mimes( (array) $existing_mimes = array() ); 

Returns (array)

Updated array of allowed upload types

Parameters (1)

0. $existing_mimes — Optional. (array) => array()
The existing mimes.

Usage

  1. if ( !function_exists( 'gde_upload_mimes' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/functions-admin.php'; 
  3.  
  4. // The existing mimes. 
  5. $existing_mimes = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gde_upload_mimes($existing_mimes); 
  9.  

Defined (1)

The function is defined in the following location(s).

/functions-admin.php  
  1. function gde_upload_mimes( $existing_mimes = array() ) { 
  2. $supported_exts = gde_supported_types(); 
  3.  
  4. foreach ( $supported_exts as $ext => $mimetype ) { 
  5. if ( ! array_key_exists( $ext, gde_mimes_expanded( $existing_mimes ) ) ) { 
  6. $existing_mimes[$ext] = $mimetype; 
  7. return gde_mimes_collapsed( $existing_mimes );