Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#26740 closed defect (bug) (invalid)

Caption not working as intended

Reported by: sjoerdsmeets's profile SjoerdSmeets Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8
Component: Media Keywords:
Focuses: Cc:


When adding an image with captions the format of the code is not according to the codex. On some sites this will work but on some it doesn't.

The caption should be placed within the opening [caption] tag and not after the img tag (before the closing caption tag). (As explained within the codex). Tested on WP3.8 and the latest nightly build. Both have this behaviour.

Change History (4)

#1 @SjoerdSmeets
10 years ago

$shcode = '[caption id="' . $id . '" align="align' . $align     . '" width="' . $width . '"]' . $html . ' ' . $caption . '[/caption]';

should be changed to

$shcode = '[caption id="' . $id . '" align="align' . $align     . '" width="' . $width . '" caption="' . $caption . '"]' . $html . '[/caption]';
Last edited 10 years ago by SjoerdSmeets (previous) (diff)

#2 @SergeyBiryukov
10 years ago

  • Keywords needs-codex added

That line was changed in [20679] to use the new format with better support of HTML tags in captions (see #18311). The change should not be reverted, Codex should probably be updated instead.

Version 0, edited 10 years ago by SergeyBiryukov (next)

#3 @bcworkz
10 years ago

  • Keywords needs-codex removed

UmeshSingla revised the Codex yesterday (30 Dec 13)

#4 @SergeyBiryukov
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.