mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-09 09:57:38 +01:00
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
This commit is contained in:
parent
450b96a773
commit
951082d4da
@ -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 ];
|
||||||
|
Loading…
Reference in New Issue
Block a user