From 9788d9142ca00ec8133703f46bf0df6a4887e4ee Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Tue, 9 Oct 2012 00:55:44 +0000 Subject: [PATCH] Properly handle inserting full size images. props timbeks, fixes #22124. git-svn-id: http://core.svn.wordpress.org/trunk@22140 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/mce-view.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/js/mce-view.js b/wp-includes/js/mce-view.js index e9c1fcf674..d9622e6edc 100644 --- a/wp-includes/js/mce-view.js +++ b/wp-includes/js/mce-view.js @@ -387,12 +387,14 @@ window.wp = window.wp || {}; classes = img['class'] ? img['class'].split(/\s+/) : []; size = attachment.sizes ? attachment.sizes[ props.size ] : {}; - if ( ! size ) + if ( ! size ) { delete props.size; + size = attachment; + } - img.width = size.width || attachment.width; - img.height = size.height || attachment.height; - img.src = size.url || attachment.url; + img.width = size.width; + img.height = size.height; + img.src = size.url; // Update `img` classes. if ( props.align )