WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 14 months ago

#15060 closed defect (bug) (worksforme)

Removing title on widget doesn't modify in-widget-title span

Reported by: chrisjean Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Widgets Keywords:
Focuses: Cc:

Description

In the widget editor, widgets with titles have this title shown in the widget editor container title. For example:

Text: Sample Widget

When a widget is first modified and saved, adding a title will cause this widget editor container title to update via JS to reflect the title update. Subsequent modifications of the title will also be reflected. However, if the title is removed, the previous title will remain.

Looking at the code shows that the in-widget-title span that holds this widget editor container title is only updated if the title value is not empty. This is easily tested by adding a Text widget, giving it a title, clicking Save, confirming that the title is reflected in the container, removing the title, and clicking Save again.

The supplied patch modifies the JS that handles this process and causes it to always update the in-widget-title span, even when the title entry is empty or missing.

Attachments (2)

fix-removed-widget-title-refresh.diff (12.8 KB) - added by chrisbliss18 4 years ago.
15060.diff (884 bytes) - added by mdawaffe 4 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 @westi4 years ago

I don't know if something went wrong when I manually applied this to the dev.js file but I couldn't get it work :-(

comment:2 @chrisbliss184 years ago

Curious. What system and browser are you using? Maybe it is a JS issue.

I'll do more testing on it.

@mdawaffe4 years ago

comment:3 @mdawaffe4 years ago

  • Milestone changed from Awaiting Review to Future Release

Patch refreshed. Needs compressing.

comment:4 @johnbillion14 months ago

  • Keywords has-patch removed
  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

This was fixed at some point. Tested in 3.8 and working as expected.

Note: See TracTickets for help on using tickets.