Make WordPress Core


Ignore:
Timestamp:
04/27/2022 05:19:52 AM (4 years ago)
Author:
peterwilsoncc
Message:

Media: Ensure wp_crop_image() returns correct file type.

Return the correct file path from wp_crop_image() when a developer modifies the file type with via the image_editor_output_format filter.

Previously the function would return a broken file reference containing the original file extension rather than the one specified via the filter.

Props mat-lipe, adamsilverstein.
Fixes #55403.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/image.php

    r52837 r53292  
    6262        if ( is_wp_error( $result ) ) {
    6363                return $result;
     64        }
     65
     66        if ( ! empty( $result['path'] ) ) {
     67                return $result['path'];
    6468        }
    6569
Note: See TracChangeset for help on using the changeset viewer.