Make WordPress Core

Changeset 22672


Ignore:
Timestamp:
11/19/2012 07:30:53 AM (11 years ago)
Author:
koopersmith
Message:

Media: Insert each attachment into the editor individually.

This allows the wpeditimage plugin to correctly identify caption shortcodes.

fixes #22459, see #21390.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/media-upload.js

    r22665 r22672  
    357357                    return;
    358358
    359                 this.insert( selection.map( function( attachment ) {
     359                selection.each( function( attachment ) {
    360360                    var detail = details[ attachment.cid ];
    361361
     
    367367
    368368                    if ( 'image' === attachment.get('type') )
    369                         return wp.media.string.image( attachment, detail ) + ' ';
     369                        this.insert( wp.media.string.image( attachment, detail ) + ' ' );
    370370                    else
    371                         return wp.media.string.link( attachment, detail ) + ' ';
    372                 }).join('') );
     371                        this.insert( wp.media.string.link( attachment, detail ) + ' ' );
     372                }, this );
    373373            }, this );
    374374
Note: See TracChangeset for help on using the changeset viewer.