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

git-svn-id: https://develop.svn.wordpress.org/trunk@22499 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2012-11-09 10:48:50 +00:00
parent 2a8c640a1f
commit 2fcc122d9c
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 = {