Ticket #52603: 52603.2.diff
File 52603.2.diff, 1.2 KB (added by , 4 years ago) |
---|
-
src/wp-admin/includes/image.php
470 470 * 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 ) { 476 476 $attachment = get_post( $attachment_id ); … … 490 490 $support = current_theme_supports( 'post-thumbnails', 'attachment:audio' ) || post_type_supports( 'attachment:audio', 'thumbnail' ); 491 491 } 492 492 493 if ( ! is_array( $metadata ) ) { 494 $metadata = array(); 495 } 496 493 497 if ( $support && ! empty( $metadata['image']['data'] ) ) { 494 498 // Check for existing cover. 495 499 $hash = md5( $metadata['image']['data'] ); … … 613 617 } 614 618 615 619 // Remove the blob of binary data from the array. 616 if ( $metadata ) { 617 unset( $metadata['image']['data'] ); 618 } 620 unset( $metadata['image']['data'] ); 619 621 620 622 /** 621 623 * Filters the generated attachment meta data.