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
This commit is contained in:
Daryl Koopersmith
2012-10-09 00:55:44 +00:00
parent 6312e4af27
commit 9788d9142c

View File

@@ -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 )