Media: Correct the image thumbnail logic in media templates.
This ensures the correct data properties are checked before displaying image thumbnails. Props chetan200891 Fixes #49655 git-svn-id: https://develop.svn.wordpress.org/trunk@49012 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
74688add2c
commit
9462c458ff
@ -536,7 +536,7 @@ function wp_print_media_templates() {
|
||||
<div class="thumbnail">
|
||||
<# if ( data.uploading ) { #>
|
||||
<div class="media-progress-bar"><div style="width: {{ data.percent }}%"></div></div>
|
||||
<# } else if ( 'image' === data.type && data.sizes ) { #>
|
||||
<# } else if ( 'image' === data.type && data.size && data.size.url ) { #>
|
||||
<div class="centered">
|
||||
<img src="{{ data.size.url }}" draggable="false" alt="" />
|
||||
</div>
|
||||
@ -598,7 +598,7 @@ function wp_print_media_templates() {
|
||||
<div class="thumbnail thumbnail-{{ data.type }}">
|
||||
<# if ( data.uploading ) { #>
|
||||
<div class="media-progress-bar"><div></div></div>
|
||||
<# } else if ( 'image' === data.type && data.sizes ) { #>
|
||||
<# } else if ( 'image' === data.type && data.size && data.size.url ) { #>
|
||||
<img src="{{ data.size.url }}" draggable="false" alt="" />
|
||||
<# } else { #>
|
||||
<img src="{{ data.icon }}" class="icon" draggable="false" alt="" />
|
||||
|
@ -2406,8 +2406,8 @@ function gallery_shortcode( $attr ) {
|
||||
function wp_underscore_playlist_templates() {
|
||||
?>
|
||||
<script type="text/html" id="tmpl-wp-playlist-current-item">
|
||||
<# if ( data.image ) { #>
|
||||
<img src="{{ data.thumb.src }}" alt="" />
|
||||
<# if ( data.thumb && data.thumb.src ) { #>
|
||||
<img src="{{ data.thumb.src }}" alt="" />
|
||||
<# } #>
|
||||
<div class="wp-playlist-caption">
|
||||
<span class="wp-playlist-item-meta wp-playlist-item-title">
|
||||
|
Loading…
Reference in New Issue
Block a user