From 9774c85abcc7e884a9424104780e75a932a460df Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 26 Nov 2012 03:33:30 +0000 Subject: [PATCH] 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 --- wp-includes/js/media-editor.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/js/media-editor.js b/wp-includes/js/media-editor.js index 1d23b5f88e..9ffeb3654c 100644 --- a/wp-includes/js/media-editor.js +++ b/wp-includes/js/media-editor.js @@ -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 ];