Make WordPress Core

Ticket #54476: 54476.diff

File 54476.diff, 628 bytes (added by adamsilverstein, 3 years ago)
  • src/wp-includes/media.php

    diff --git src/wp-includes/media.php src/wp-includes/media.php
    index 01543b9dcd..62ec9615d7 100644
    function wp_get_image_editor( $path, $args = array() ) { 
    37513751                }
    37523752        }
    37533753
     3754        /** This filter is documented in wp-includes/class-wp-image-editor.php */
     3755        $output_format = apply_filters( 'image_editor_output_format', array(), $path, $args['mime_type'] );
     3756        if ( isset( $output_format[ $args['mime_type'] ] ) ) {
     3757                $args['mime_type'] = $output_format[ $mime_type ];
     3758        }
     3759
    37543760        $implementation = _wp_image_editor_choose( $args );
    37553761
    37563762        if ( $implementation ) {