Opened 12 years ago
Closed 12 years ago
#22459 closed defect (bug) (fixed)
Inserting captionless and captioned image together causes shortcode to appear in visual mode
Reported by: | trepmal | Owned by: | koopersmith |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Media | Keywords: | needs-patch |
Focuses: | Cc: |
Description
- select an image with no caption
- select an image with a caption
- batch-insert into post
The [caption]
shortcode will appear in the visual editor.
Change History (4)
#3
@
12 years ago
- Keywords needs-patch added
The wpeditimage
plugin searches for captions by checking if the inserted string begins with [caption
. With multiple images, we're inserting a single string, which is causing the issue here. Instead, we should be inserting multiple strings.
This can be fixed by going into media-upload.js
and changing the insert event callback to use each
instead of map
, and moving the call to insert
into the loop.
Note: See
TracTickets for help on using
tickets.
It seems like it's generating the HTML in media-upload.js, around line 368-372, where the code is directly inserted inside of the Visual editor and not evaluated or hidden (and visible only in the Text version).