Make WordPress Core


Ignore:
Timestamp:
03/18/2014 03:24:17 AM (12 years ago)
Author:
azaozz
Message:

TinyMCE gallery preview: fix errors when an image doesn't have/is smaller than thumbnail size, props gcorne, see #26959

File:
1 edited

Legend:

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

    r27578 r27580  
    898898        </div>
    899899    </script>
    900     <?php
    901 
    902         //TODO: do we want to deal with the fact that the elements used for gallery items are filterable and can be overriden via shortcode attributes
    903         // do we want to deal with the difference between display and edit context at all? (e.g. wptexturize() being applied to the caption.
    904     ?>
    905 
    906900    <script type="text/html" id="tmpl-editor-gallery">
    907901        <div class="toolbar">
     
    913907                <dl class="gallery-item">
    914908                    <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 }}}" />
     909                        <img src="{{{ attachment.thumbnail.url }}}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" />
    917910                    </dt>
    918911                    <dd class="wp-caption-text gallery-caption">
     
    920913                    </dd>
    921914                </dl>
    922                 <?php // this is kind silly, but copied from the gallery shortcode. Maybe it should be removed ?>
    923915                <# if ( index % data.columns === data.columns - 1 ) { #>
    924916                    <br style="clear: both;">
Note: See TracChangeset for help on using the changeset viewer.