Changeset 53786 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
- Timestamp:
- 07/27/2022 03:13:16 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r52068 r53786 784 784 785 785 $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 } 786 795 } 787 796 … … 796 805 'source_url' => $full_src[0], 797 806 ); 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 } 798 816 } 799 817 } else {
Note: See TracChangeset
for help on using the changeset viewer.