Make WordPress Core

Changeset 23055


Ignore:
Timestamp:
12/05/2012 12:59:25 AM (12 years ago)
Author:
nacin
Message:

Fix inserting of multiple attachments with captions when the first attachment does not have a caption. props azaozz. fixes #22720.

Location:
trunk
Files:
2 edited

Legend:

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

    r22770 r23055  
    2525            ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
    2626
    27         if ( h.indexOf('[caption') === 0 ) {
     27        if ( h.indexOf('[caption') !== -1 ) {
    2828            if ( ed.wpSetImgCaption )
    2929                h = ed.wpSetImgCaption(h);
    30         } else if ( h.indexOf('[gallery') === 0 ) {
     30        } else if ( h.indexOf('[gallery') !== -1 ) {
    3131            if ( ed.plugins.wpgallery )
    3232                h = ed.plugins.wpgallery._do_gallery(h);
  • trunk/wp-includes/js/media-editor.js

    r23042 r23055  
    353353                    ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
    354354
    355                 if ( h.indexOf('[caption') === 0 ) {
     355                if ( h.indexOf('[caption') !== -1 ) {
    356356                    if ( ed.wpSetImgCaption )
    357357                        h = ed.wpSetImgCaption(h);
    358                 } else if ( h.indexOf('[gallery') === 0 ) {
     358                } else if ( h.indexOf('[gallery') !== -1 ) {
    359359                    if ( ed.plugins.wpgallery )
    360360                        h = ed.plugins.wpgallery._do_gallery(h);
Note: See TracChangeset for help on using the changeset viewer.