WordPress.org

Make WordPress Core

Opened 36 hours ago

Last modified 36 hours ago

#41087 new defect (bug)

Customizer: Deleting a Widget does not remove instance in options

Reported by: timmydcrawford Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8
Component: Customize Keywords:
Focuses: Cc:

Description

When deleting a widget from widgets.php, for example a new Media Image Widget, the widget instance is removed from the widget_media_image site option, along with association/placement value in sidebars_widgets.

However, if a widget is removed using the customizer, the widget data ( again in this case testing with an image widget ), still exists in get_option( 'widget_media_image' ), while the entry in sidebars_widgets is again properly removed.

It seems removal of a widget in both places ( widgets.php and customizer ) should result in the removal from the associated option in both cases.

Change History (1)

#1 @timmydcrawford
36 hours ago

Confirmed the issue on trunk too.

Steps to re-create:

  • Add a new image widget ( or any widget )
  • Delete the widget via the customizer
  • get_option('widget_media_image')
Note: See TracTickets for help on using tickets.