Use attachment.url only if it is available, else fall back to props.url.

see #24046. see [24009].

git-svn-id: http://core.svn.wordpress.org/trunk@24017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mark Jaquith 2013-04-17 17:57:51 +00:00
parent ba20ddbcc0
commit 51e5c3436e

View File

@ -191,7 +191,7 @@
props = wp.media.string.props( props, attachment );
classes = props.classes || [];
img.src = props.url;
img.src = typeof attachment !== 'undefined' ? attachment.url : props.url;
_.extend( img, _.pick( props, 'width', 'height', 'alt' ) );
// Only assign the align class to the image if we're not printing