image_editor_default_mime_type

Filters default mime type prior to getting the file extension.

Description

apply_filters( 'image_editor_default_mime_type', (string) $this_default_mime_type ); 

Parameters (1)

0. $this_default_mime_type (string)
The this default mime type.

Usage

To run the hook, copy the example below.
  1. $this_default_mime_type = apply_filters( 'image_editor_default_mime_type', $this_default_mime_type ); 
  2.  
  3. if ( !empty( $this_default_mime_type ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the image_editor_default_mime_type callback 
  2. function filter_image_editor_default_mime_type( $this_default_mime_type ) { 
  3. // make filter magic happen here... 
  4. return $this_default_mime_type
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'image_editor_default_mime_type', 'filter_image_editor_default_mime_type', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'image_editor_default_mime_type', 'filter_image_editor_default_mime_type', 10, 1 ); 

Defined (1)

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

/wp-includes/class-wp-image-editor.php  
  1. $mime_type = apply_filters( 'image_editor_default_mime_type', $this->default_mime_type );