WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 4 months ago

#42604 closed defect (bug) (fixed)

Problem: alignment of image with caption

Reported by: slilley Owned by: obenland
Milestone: 5.0 Priority: normal
Severity: normal Version: 4.9
Component: Bundled Theme Keywords:
Focuses: Cc:

Description

Using Twenty-Ten them, if you put an image in a post, give it a caption and align it "none", the image should remain default-left aligned, with a small frame, and no text wrap.

After WP 4.9, that same image will now appear centered in the post, with a frame (and caption) that extends the full width of the post.

Attachments (5)

pre_4_9.jpg (160.2 KB) - added by slilley 8 months ago.
display, pre-WP4.9
post_4_9.jpg (164.7 KB) - added by slilley 8 months ago.
display within WP4.9
shortcaption.jpg (156.1 KB) - added by slilley 8 months ago.
Screen Shot 2018-01-18 at 12.14.png (718.2 KB) - added by slilley 6 months ago.
42604.full-size.PNG (84.7 KB) - added by SergeyBiryukov 4 months ago.

Download all attachments as: .zip

Change History (27)

@slilley
8 months ago

display, pre-WP4.9

@slilley
8 months ago

display within WP4.9

#1 follow-up: @hardeepasrani
8 months ago

  • Component changed from General to Themes

I think I found the issue in the theme, but I'm just wondering if the Twenty Ten theme is still being maintained?

#2 @hardeepasrani
8 months ago

  • Component changed from Themes to Bundled Theme

#3 in reply to: ↑ 1 @slilley
8 months ago

Replying to hardeepasrani:

I think I found the issue in the theme, but I'm just wondering if the Twenty Ten theme is still being maintained?

Yes, Twenty Ten theme has been updated.

#4 follow-up: @Clorith
8 months ago

  • Component changed from Bundled Theme to Media
  • Milestone changed from Awaiting Review to 4.9.2

Introduced in r41724

The use of max-width on the container lets the wp-caption-text cause it to overflow for some reason, providing a max-width that mimics the parents max width might be an idea (so far only observed on themes that do not have HTML5 support, so it might be something there)

#5 in reply to: ↑ 4 @slilley
8 months ago

Even if the caption is short (i.e. narrower than the image), the shaded frame still goes wide.

Replying to Clorith:

Introduced in r41724

The use of max-width on the container lets the wp-caption-text cause it to overflow for some reason, providing a max-width that mimics the parents max width might be an idea (so far only observed on themes that do not have HTML5 support, so it might be something there)

@slilley
8 months ago

#6 @obenland
7 months ago

  • Component changed from Media to Bundled Theme
  • Owner set to obenland
  • Status changed from new to accepted

#7 @obenland
7 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 42386:

Twenty Ten: Use global img contraint for captions

Fixes an incompatibility with the way caption width is set since 4.9, where the caption element would cover the whole content width.

Props slilley, Clorith, hardeepasrani.
Fixes #42604.

#8 @slilley
6 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I still see the same problem on my end. Not fixed yet.

#9 follow-up: @obenland
6 months ago

@slilley Do you have a public test site that I can access with the fix not working. Does it still occur for anyone else?

#10 @Clorith
6 months ago

Patch is good on my end.

Just a note for those still experiencing this issue, this is prepared for version 4.9.2, which has not been released yet, so you won't see any change unless you are using the beta tester plugin or any other method of testing the new release.

#11 @dd32
6 months ago

  • Milestone changed from 4.9.2 to 4.9.3

Bumping to 4.9.3 due to 4.9.2s release

This ticket was mentioned in Slack in #core by desrosj. View the logs.


6 months ago

#13 in reply to: ↑ 9 @slilley
6 months ago

Replying to obenland:

@slilley Do you have a public test site that I can access with the fix not working. Does it still occur for anyone else?

Sure — here's an example on a page from my site: http://recklesslistening.com/2010/03/26/greeting-card-emergency/

I'm running WP 4.9.2, and using a child theme of Twenty-Ten 2.4. And I still get the problem even when I switch from my child theme into straight Twenty-Ten 2.4.

#14 @obenland
6 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

Yeah, your version of Twenty Ten doesn't have [42386] applied, it still forcibly sets the caption width to the full content width. Once that's updated, it'll be fixed.

This ticket was mentioned in Slack in #core by clorith. View the logs.


6 months ago

#16 @SergeyBiryukov
6 months ago

  • Milestone changed from 4.9.3 to 5.0

Moving to 5.0, as bundled themes are generally updated with major releases.

#17 @portpass1974
5 months ago

Is there a fix for this yet? It's still causing the captions to be "justified". See at http://rogerannis.com/austerity-militaristic-government-budget-canada/.

This ticket was mentioned in Slack in #core by sergey. View the logs.


4 months ago

#19 @SergeyBiryukov
4 months ago

  • Milestone changed from 5.0 to 4.9.5
  • Resolution fixed deleted
  • Status changed from closed to reopened

Given that we're going to include #43317 in 4.9.5, reopening this one for a backport as well. See #43572.

#20 @SergeyBiryukov
4 months ago

  • Milestone changed from 4.9.5 to 4.9.6

Looks like this needs some more work:

  • .wp-caption img { max-width: 622px; /* caption width - 10px */ } is a remnant of the line removed in [42386].
  • .wp-caption still needs a max-width, as full-sized images with a caption break the layout now, see 42604.full-size.PNG.
  • editor-style.css should be updated as well.

#21 @SergeyBiryukov
4 months ago

  • Milestone changed from 4.9.6 to 5.0

[41724] was reverted in [42838], which will ship in 4.9.5, returning the caption shortcode to the pre-4.9.0 behavior.

Seems like reverting [42386] would be the way to go for trunk, no changes are needed for the 4.9 branch.

#22 @SergeyBiryukov
4 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 42886:

Twenty Ten: Restore max-width on .wp-caption.

[42837] fixed the compatibility issue caused by [41724], returning the caption shortcode to the pre-4.9.0 behavior.

Reverts [42386].
Fixes #42604.

Note: See TracTickets for help on using tickets.