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
369            * @param string[] $output_format {
370            *     An array of mime type mappings. Maps a source mime type to a new
371            *     destination mime type. Default empty array.
372            *
373            *     @type string ...$0 The new mime type.
374            * }
375            * @param string $filename  Path to the image.
376            * @param string $mime_type The source image mime type.
377            */
378           $output_format = apply_filters( 'image_editor_output_format', array(), $filename, $mime_type );
379
380           if ( isset( $output_format[ $mime_type ] )
381                && $this->supports_mime_type( $output_format[ $mime_type ] )
382           ) {
383                $mime_type = $output_format[ $mime_type ];
384                $new_ext   = $this->get_extension( $mime_type );
385           }
386
387           // Double-check that the mime-type selected is supported by the editor.