WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#10455 closed defect (bug) (duplicate)

Multiple adjacent [caption] shortcodes produce incorrect output

Reported by: essday Owned by:
Milestone: Priority: low
Severity: normal Version: 2.8.1
Component: Shortcodes Keywords: caption, image
Focuses: Cc:

Description

Somewhere between WP 2.7.1 and 2.8.1, the support for multiple adjacent "[caption]" tags in a post body became broken.

For example, I could enter the following code into the post textbox when creating a post in 2.7.x:

[caption id="attachment_437" align="alignnone" width="100" caption="DESCRIPTION OF MY FIRST IMAGE HERE"]<a href="(...)Img_001.jpg"><img src="(...)Img_001-100x150.jpg" alt="DESCRIPTION OF MY FIRST IMAGE HERE" title="DESCRIPTION OF MY FIRST IMAGE HERE" width="100" height="150" class="size-thumbnail wp-image-437" /></a>[/caption][caption id="attachment_435" align="alignnone" width="100" caption="DESCRIPTION OF MY SECOND IMAGE HERE"]<a href="(...)Img_002.jpg"><img src="(...)Img_002.jpg" alt="DESCRIPTION OF MY SECOND IMAGE HERE" title="DESCRIPTION OF MY SECOND IMAGE HERE" width="100" height="150" class="size-thumbnail wp-image-435" /></a>[/caption]

In 2.7.x, this outputs two DIV sections, each containing the appropriate image and corresponding caption.

Under 2.8.x, the first DIV section (containing Img_001) is output properly, but the entire caption block for the section caption (with Img_002) is output as plaintext in the post (including the literal text "[caption]") and no fancy DIV is output for this section.

This issue seemingly corrects itself if one inserts a space between the first "/caption" closing tag and the subsequent "caption" opening tag.

For the original message thread, see http://wordpress.org/support/topic/291369.

(Please excuse the lack of wordwrap in this issue--I couldn't figure out how to keep Trac from mangling the excerpt above without sticking it in a code block, but then everything else in the post gets un-wordwrapped.)

Change History (3)

comment:1 essday5 years ago

  • Cc essday added

comment:2 TobiasBg5 years ago

  • Component changed from Media to Shortcodes
  • Resolution set to duplicate
  • Status changed from new to closed
  • Summary changed from Multiple adjacent [caption] tags in post body produce incorrect output to Multiple adjacent [caption] shortcodes produce incorrect output

This actually affects all shortcodes: dup of #10082

comment:3 Denis-de-Bernardy4 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.