Use attachment.url only if it is available, else fall back to props.url.
see #24046. see [24009]. git-svn-id: https://develop.svn.wordpress.org/trunk@24017 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0a7a82c53b
commit
e29dc811f7
|
@ -191,7 +191,7 @@
|
||||||
props = wp.media.string.props( props, attachment );
|
props = wp.media.string.props( props, attachment );
|
||||||
classes = props.classes || [];
|
classes = props.classes || [];
|
||||||
|
|
||||||
img.src = props.url;
|
img.src = typeof attachment !== 'undefined' ? attachment.url : props.url;
|
||||||
_.extend( img, _.pick( props, 'width', 'height', 'alt' ) );
|
_.extend( img, _.pick( props, 'width', 'height', 'alt' ) );
|
||||||
|
|
||||||
// Only assign the align class to the image if we're not printing
|
// Only assign the align class to the image if we're not printing
|
||||||
|
|
Loading…
Reference in New Issue