Opened 10 years ago
Closed 9 years ago
#31780 closed defect (bug) (invalid)
Nested shortocdes - visual/text editor wipes them out
Reported by: | johnmontfx | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.9 |
Component: | TinyMCE | Keywords: | |
Focuses: | Cc: |
Description
Utilizing the following shortcode results in it eventually being stripped from the visual editor:
[caption width="600" caption="A football video"][video width="640" height="360" mp4="http://mydomain.com/wp-contentt/uploads/2015/03/my_movie.mp4"][/caption]
Replication steps;
- Create new post
- In visual editor, paste the above code. This seems to work.
- Switch to text editor mode.
- Code is borked.
Also, this shows the issue:
- Create new post
- In text editor, paste the above code. This seems to work.
- Switch to visual text editor mode. This seems to work.
- Switch back to text editor mode
- Code is borked.
I've confirmed this bug on multiple sites running 4.0 and 4.1 variants, including a dev site with no plugins installed and using the twenty fifteen theme.
I assume tinymce is to blame...but that's beyond my pay grade
Change History (4)
#2
@
10 years ago
The codex does say it can be used on content other than images. And it seems (at one point), it worked for nested shortcodes as can be seen here: http://justintadlock.com/archives/2011/07/01/captions-in-wordpress
Obviously, whether or not that was officially supported is another question.... :)
(Edited -- to remove our use of it previously. We wrote our own shortcode for videos that allows captions and didn't use the built in functionality).
#3
@
10 years ago
- Keywords close added
The callback function is called img_caption_shortcode
, so I guess not. :)
All the code there and in the TinyMCE plugin is specifically for images.
https://core.trac.wordpress.org/browser/tags/4.2/src/wp-includes/media.php#L815
#4
@
9 years ago
- Keywords close removed
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Agreed with comment:3. I think its unreasonable to expect captions to work on something that it was never intended to work on (given the callback name). Closing as invalid.
I'm not sure if we even support captions for anything other than images.