Media: Output correct link html when inserting attachments. see #21390.

git-svn-id: http://core.svn.wordpress.org/trunk@22499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-09 10:48:50 +00:00
parent 06830f4501
commit 0c219be45d
1 changed files with 10 additions and 0 deletions

View File

@ -484,6 +484,16 @@ window.wp = window.wp || {};
single: true
};
// Generate the `href` based on the `link` property.
if ( props.link && 'none' !== props.link ) {
props.anchor = props.anchor || {};
if ( 'post' === props.link )
props.anchor.href = attachment.link;
else if ( 'file' === props.link )
props.anchor.href = attachment.url;
}
// Generate the `a` element options, if they exist.
if ( props.anchor ) {
options = {