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

git-svn-id: https://develop.svn.wordpress.org/trunk@22835 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-11-26 03:33:30 +00:00
parent 1b8e6d9ac6
commit 9774c85abc
1 changed files with 6 additions and 4 deletions

View File

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