Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: image_editor_output_format

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
3864           // figure out the file type, rather than forcing a failure based on extension.
3865           if ( isset( $file_info ) && $file_info['type'] ) {
3866                $args['mime_type'] = $file_info['type'];
3867           }
3868      }
3869
3870      // Check and set the output mime type mapped to the input type.
3871      if ( isset( $args['mime_type'] ) ) {
3872           /** This filter is documented in wp-includes/class-wp-image-editor.php */
3873           $output_format = apply_filters( 'image_editor_output_format', array(), $path, $args['mime_type'] );
3874           if ( isset( $output_format[ $args['mime_type'] ] ) ) {
3875                $args['output_mime_type'] = $output_format[ $args['mime_type'] ];
3876           }
3877      }
3878
3879      $implementation = _wp_image_editor_choose( $args );
3880
3881      if ( $implementation ) {
3882           $editor = new $implementation( $path );