mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Media: Insert each attachment into the editor individually.
This allows the `wpeditimage` plugin to correctly identify `caption` shortcodes. fixes #22459, see #21390. git-svn-id: http://core.svn.wordpress.org/trunk@22672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
549b5f61ae
commit
fe1e4e3f56
@ -356,7 +356,7 @@ var tb_position;
|
||||
if ( ! selection || ! details )
|
||||
return;
|
||||
|
||||
this.insert( selection.map( function( attachment ) {
|
||||
selection.each( function( attachment ) {
|
||||
var detail = details[ attachment.cid ];
|
||||
|
||||
if ( detail )
|
||||
@ -366,10 +366,10 @@ var tb_position;
|
||||
delete details[ attachment.cid ];
|
||||
|
||||
if ( 'image' === attachment.get('type') )
|
||||
return wp.media.string.image( attachment, detail ) + ' ';
|
||||
this.insert( wp.media.string.image( attachment, detail ) + ' ' );
|
||||
else
|
||||
return wp.media.string.link( attachment, detail ) + ' ';
|
||||
}).join('') );
|
||||
this.insert( wp.media.string.link( attachment, detail ) + ' ' );
|
||||
}, this );
|
||||
}, this );
|
||||
|
||||
workflow.get('gallery-edit').on( 'update', function( selection ) {
|
||||
|
Loading…
Reference in New Issue
Block a user