Make WordPress Core


Ignore:
Timestamp:
04/07/2014 09:24:02 PM (11 years ago)
Author:
nacin
Message:

Gallery Views: Avoid JS errors when image attachments lack metadata.

props gcorne.
fixes #27691.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media-template.php

    r28003 r28008  
    976976                    <dl class="gallery-item">
    977977                        <dt class="gallery-icon">
    978                             <img src="{{{ attachment.thumbnail.url }}}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" />
     978                            <# if ( attachment.thumbnail ) { #>
     979                                <img src="{{ attachment.thumbnail.url }}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" />
     980                            <# } else { #>
     981                                <img src="{{ attachment.url }}" />
     982                            <# } #>
    979983                        </dt>
    980984                        <dd class="wp-caption-text gallery-caption">
Note: See TracChangeset for help on using the changeset viewer.