From 951082d4da1612b55f94cf1c5969e6176b7392d1 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: http://core.svn.wordpress.org/trunk@22835 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 ];