diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index 72c9230f0a..b37742343f 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -2139,7 +2139,7 @@ options.describe = this.controller.state().get('describe'); if ( 'image' === options.type ) - _.extend( options, this.imageSize() ); + options.size = this.imageSize(); this.$el.html( this.template( options ) ); diff --git a/wp-includes/media.php b/wp-includes/media.php index 145ec45bed..d9551e341d 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1280,12 +1280,14 @@ function wp_prepare_attachment_for_js( $attachment ) { } } - $response = array_merge( $response, array( + $sizes['full'] = array( 'height' => $meta['height'], 'width' => $meta['width'], - 'sizes' => $sizes, + 'url' => $attachment_url, 'orientation' => $meta['height'] > $meta['width'] ? 'portrait' : 'landscape', - ) ); + ); + + $response = array_merge( $response, array( 'sizes' => $sizes ), $sizes['full'] ); } if ( function_exists('get_compat_media_markup') ) @@ -1430,7 +1432,7 @@ function wp_print_media_templates( $attachment ) { <# } else if ( 'image' === data.type ) { #>
- +
<# } else { #> @@ -1468,7 +1470,7 @@ function wp_print_media_templates( $attachment ) { <# if ( data.uploading ) { #>
<# } else if ( 'image' === data.type ) { #> - + <# } else { #> <# } #> @@ -1609,22 +1611,15 @@ function wp_print_media_templates( $attachment ) { 'full' => __('Full Size'), ) ); - foreach ( $sizes as $value => $name ) : - if ( 'full' === $name ) - continue; - ?> - <# if ( data.sizes[''] ) { #> + foreach ( $sizes as $value => $name ) : ?> + <# + var size = data.sizes['']; + if ( size ) { #> <# } #>> - - - + <# } #>