Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#42350 closed defect (bug) (fixed)

Caption on media image widget can't be empty

Reported by: miyauchi's profile miyauchi Owned by: westonruter's profile 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 7 years ago.
42350.2.diff (2.5 KB) - added by westonruter 7 years ago.

Download all attachments as: .zip

Change History (5)

@miyauchi
7 years ago

#1 @miyauchi
7 years ago

  • Keywords has-patch added

I added a patch to fix this problem.

#2 @westonruter
7 years 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
7 years ago

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