WordPress.org

Ready to get started?Download WordPress

Forums

Multiple captions broken in 2.8.x? (5 posts)

  1. essday
    Member
    Posted 5 years ago #

    Hello, all!

    In WP 2.7.x, I was able to use the "[caption]" nomenclature when writing posts to insert images and their corresponding captions.

    After the update to WP 2.8.1, I noticed that this feature seems to be broken when multiple "[caption]" sections are used in a single post. This appears to be a problem that was newly introduced in the 2.8 series. (Note that I upgraded directly from 2.7.1 to 2.8.1.)

    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]").

    Any ideas? Is this a bug or am I doing something wrong?

    Thanks,
    - essday

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    Have you tried switching to the default theme to check whether this is an theme-specific issue?

  3. essday
    Member
    Posted 5 years ago #

    That's a good suggestion. I just tried it, and yes, it's still broken when using the default theme.

  4. esmi
    Forum Moderator
    Posted 5 years ago #

    Just tried it on one of my dev sites and can confirm the bug. The fix (for now) is to place at least 1 blank space between the 2 caption shortcodes.

    I can't find any report of this bug on Trac, so do you want to submit a bug report?

  5. essday
    Member
    Posted 5 years ago #

    Thanks for the workaround!

    Done as #10455.
    http://core.trac.wordpress.org/ticket/10455

Topic Closed

This topic has been closed to new replies.

About this Topic