Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#26740 closed defect (bug) (invalid)

Caption not working as intended

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

Description

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
8 years ago

http://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/media.php#L157

$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 8 years ago by SjoerdSmeets (previous) (diff)

#2 @SergeyBiryukov
8 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.

Last edited 8 years ago by SergeyBiryukov (previous) (diff)

#3 @bcworkz
8 years ago

  • Keywords needs-codex removed

UmeshSingla revised the Codex yesterday (30 Dec 13)

#4 @SergeyBiryukov
8 years ago

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