From c71437b94bb372e90df3267be99e8f64a40f96ca Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 18 Aug 2014 02:35:17 +0000 Subject: [PATCH] Media Grid: don't try to display images that don't have `data.sizes` set. Also, don't show the "Edit Image" button. Props ocean90. Fixes #29245. Built from https://develop.svn.wordpress.org/trunk@29528 git-svn-id: http://core.svn.wordpress.org/trunk@29304 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media-template.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/media-template.php b/wp-includes/media-template.php index 3c20ef7a5d..71bfc2809e 100644 --- a/wp-includes/media-template.php +++ b/wp-includes/media-template.php @@ -276,7 +276,7 @@ function wp_print_media_templates() {
<# if ( data.uploading ) { #>
- <# } else if ( 'image' === data.type ) { #> + <# } else if ( 'image' === data.type && data.sizes && data.sizes.full ) { #> <# } else if ( -1 === jQuery.inArray( data.type, [ 'audio', 'video' ] ) ) { #> @@ -310,7 +310,7 @@ function wp_print_media_templates() { <# } #>
- <# if ( 'image' === data.type && ! data.uploading ) { #> + <# if ( 'image' === data.type && ! data.uploading && data.sizes ) { #> <# } #>
@@ -425,7 +425,7 @@ function wp_print_media_templates() {
<# if ( data.uploading ) { #>
- <# } else if ( 'image' === data.type ) { #> + <# } else if ( 'image' === data.type && data.sizes ) { #>
@@ -481,7 +481,7 @@ function wp_print_media_templates() {
<# if ( data.uploading ) { #>
- <# } else if ( 'image' === data.type ) { #> + <# } else if ( 'image' === data.type && data.sizes ) { #> <# } else { #>