Make WordPress Core


Ignore:
Timestamp:
09/06/2022 09:11:41 PM (22 months ago)
Author:
adamsilverstein
Message:

Media: revert the multi-mime feature.

This feature isn't quite ready to land.

Reverts r53786, r53848, r53847, r53845, r53751.

Props flixos90, azaozz, dd32.
See #55443.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

    r53786 r54085  
    784784
    785785                    $size_data['source_url'] = $image_src[0];
    786 
    787                     if ( empty( $size_data['sources'] ) || ! is_array( $size_data['sources'] ) ) {
    788                         continue;
    789                     }
    790 
    791                     $image_url_basename = wp_basename( $image_src[0] );
    792                     foreach ( $size_data['sources'] as $mime => &$mime_details ) {
    793                         $mime_details['source_url'] = str_replace( $image_url_basename, $mime_details['file'], $image_src[0] );
    794                     }
    795786                }
    796787
     
    805796                        'source_url' => $full_src[0],
    806797                    );
    807 
    808                     if ( ! empty( $data['media_details']['sources'] ) ) {
    809                         $full_url_basename = wp_basename( $full_src[0] );
    810                         foreach ( $data['media_details']['sources'] as $mime => &$mime_details ) {
    811                             $mime_details['source_url'] = str_replace( $full_url_basename, $mime_details['file'], $full_src[0] );
    812                         }
    813                         $data['media_details']['sizes']['full']['sources'] = $data['media_details']['sources'];
    814                         unset( $data['media_details']['sources'] );
    815                     }
    816798                }
    817799            } else {
Note: See TracChangeset for help on using the changeset viewer.