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 Built from https://develop.svn.wordpress.org/trunk@49012 git-svn-id: http://core.svn.wordpress.org/trunk@48774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -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="" />
|
||||
|
||||
Reference in New Issue
Block a user