Media: Include the link URL when inserting non-image attachments. props koopersmith. fixes #22544.

git-svn-id: http://core.svn.wordpress.org/trunk@22835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-11-26 03:33:30 +00:00
parent 450b96a773
commit 951082d4da
1 changed files with 6 additions and 4 deletions

View File

@ -426,15 +426,17 @@
id: attachment.id
};
if ( props.linkUrl )
options.url = props.linkUrl;
if ( 'image' === attachment.type ) {
html = wp.media.string.image( props );
options['caption'] = caption;
_.each({
align: 'image-align',
size: 'image-size',
alt: 'image-alt',
linkUrl: 'url'
align: 'image-align',
size: 'image-size',
alt: 'image-alt'
}, function( option, prop ) {
if ( props[ prop ] )
options[ option ] = props[ prop ];