WordPress.org

Make WordPress Core

Opened 4 weeks ago

Closed 4 weeks ago

#42350 closed defect (bug) (fixed)

Caption on media image widget can't be empty

Reported by: miyauchi Owned by: westonruter
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.9
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description

If we insert a image which has a caption text and we try to clear the caption on the image details screen at the widgets page.
Then caption text always will be used from the value of $attachment->post_excerpt.
So, we can't be empty caption text at the image widget.

Is this behavior intentional?

I guess we should remove line 180.
https://github.com/WordPress/wordpress-develop/blob/master/src/wp-includes/widgets/class-wp-widget-media-image.php#L180-L183

https://www.evernote.com/l/ABVM0O7iS0hIK4d5FuVW9oy4qzIcPjg098kB/image.png

Attachments (2)

42350.diff (529 bytes) - added by miyauchi 4 weeks ago.
42350.2.diff (2.5 KB) - added by westonruter 4 weeks ago.

Download all attachments as: .zip

Change History (5)

@miyauchi
4 weeks ago

#1 @miyauchi
4 weeks ago

  • Keywords has-patch added

I added a patch to fix this problem.

#2 @westonruter
4 weeks ago

  • Milestone changed from Awaiting Review to 4.9
  • Owner set to westonruter
  • Status changed from new to accepted

Yeah, this makes sense to me.

@westonruter
4 weeks ago

#3 @westonruter
4 weeks ago

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

In 42030:

Widgets: Prevent showing underlying attachment excerpt as caption when empty caption value is supplied in Image widget.

Allow underlying attachment to display if caption is null.

Props miyauchi, westonruter.
See #39993.
Fixes #42350.

Note: See TracTickets for help on using tickets.