WordPress.org

Make WordPress Core

Ticket #36838: 36838.diff

File 36838.diff, 591 bytes (added by swissspidy, 3 years ago)
  • src/wp-includes/theme-compat/embed-content.php

    diff --git src/wp-includes/theme-compat/embed-content.php src/wp-includes/theme-compat/embed-content.php
    index 05498eb..fca4f38 100644
     
    2727                $image_size   = 'full'; // Fallback.
    2828
    2929                $meta = wp_get_attachment_metadata( $thumbnail_id );
    30                 if ( is_array( $meta ) ) {
     30                if ( ! empty( $meta['sizes'] ) ) {
    3131                        foreach ( $meta['sizes'] as $size => $data ) {
    3232                                if ( $data['width'] / $data['height'] > $aspect_ratio ) {
    3333                                        $aspect_ratio = $data['width'] / $data['height'];