Make WordPress Core

Ticket #26959: 26959-ensure-thumb-in-template.diff

File 26959-ensure-thumb-in-template.diff, 847 bytes (added by adamsilverstein, 11 years ago)

alternate method to ensure thumbnail works

  • src/wp-includes/media-template.php

     
    912912                        <# _.each( data.attachments, function( attachment, index ) { #>
    913913                                <dl class="gallery-item">
    914914                                        <dt class="gallery-icon">
    915                                                 <?php // TODO: need to figure out the best way to make sure that we have thumbnails ?>
    916                                                 <img src="{{{ attachment.sizes.thumbnail.url }}}" />
     915                                                <# if ( 'undefined' !== typeof attachment.sizes.thumbnail ) { #>
     916                                                        <img src="{{{ attachment.sizes.thumbnail.url }}}" />
     917                                                <# } else { #>
     918                                                        <img src="{{{ attachment.sizes.full.url }}}" />
     919                                                <# } #>
    917920                                        </dt>
    918921                                        <dd class="wp-caption-text gallery-caption">
    919922                                                {{ attachment.caption }}