Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#31780 closed defect (bug) (invalid)

Nested shortocdes - visual/text editor wipes them out

Reported by: johnmontfx's profile 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;

  1. Create new post
  2. In visual editor, paste the above code. This seems to work.
  3. Switch to text editor mode.
  4. Code is borked.

Also, this shows the issue:

  1. Create new post
  2. In text editor, paste the above code. This seems to work.
  3. Switch to visual text editor mode. This seems to work.
  4. Switch back to text editor mode
  5. 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)

#1 @iseulde
10 years ago

  • Version changed from 4.1 to 3.9

I'm not sure if we even support captions for anything other than images.

#2 @johnmontfx
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).

Last edited 10 years ago by johnmontfx (previous) (diff)

#3 @iseulde
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 @chriscct7
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.

Note: See TracTickets for help on using tickets.