Make WordPress Core

Opened 8 months ago

Closed 8 months 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:


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


Attachments (2)

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

Download all attachments as: .zip

Change History (5)

8 months ago

#1 @miyauchi
8 months ago

  • Keywords has-patch added

I added a patch to fix this problem.

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

8 months ago

#3 @westonruter
8 months 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.