Opened 14 years ago
Closed 14 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Media | Version: | 3.5 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: |
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
@
14 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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).