gde_mimes_collapsed

The Google Doc Embedder gde mimes collapsed function.

Description

gde_mimes_collapsed( $types ); 

Parameters (1)

0. $types
The types.

Usage

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

Defined (1)

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

/functions-admin.php  
  1. function gde_mimes_collapsed( $types ) { 
  2. // collapes the supported mime types so that each mime is listed once with combined key (default) 
  3. $newtypes = array(); 
  4.  
  5. foreach ( $types as $k => $v ) { 
  6. if ( isset( $newtypes[$v] ) ) { 
  7. $newtypes[$v] .= '|' . $k; 
  8. } else { 
  9. $newtypes[$v] = $k; 
  10. return array_flip( $newtypes );