Changeset 51162
- Timestamp:
- 06/15/2021 04:51:54 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/image.php
r50815 r51162 471 471 * @param int $attachment_id Attachment Id to process. 472 472 * @param string $file Filepath of the Attached image. 473 * @return mixedMetadata for attachment.473 * @return array Metadata for attachment. 474 474 */ 475 475 function wp_generate_attachment_metadata( $attachment_id, $file ) { … … 489 489 $metadata = wp_read_audio_metadata( $file ); 490 490 $support = current_theme_supports( 'post-thumbnails', 'attachment:audio' ) || post_type_supports( 'attachment:audio', 'thumbnail' ); 491 } 492 493 // wp_read_video_metadata() and wp_read_audio_metadata() return `false` if the attachment 494 // does not exist in the local filesystem, so make sure to convert the value to an array. 495 if ( ! is_array( $metadata ) ) { 496 $metadata = array(); 491 497 } 492 498 … … 617 623 618 624 // Remove the blob of binary data from the array. 619 if ( $metadata ) { 620 unset( $metadata['image']['data'] ); 621 } 625 unset( $metadata['image']['data'] ); 622 626 623 627 /**
Note: See TracChangeset
for help on using the changeset viewer.