WordPress.org

Make WordPress Core

Opened 12 months ago

Last modified 3 months ago

#39693 closed enhancement

Fix missing assignment of widgets on theme switch — at Version 7

Reported by: melchoyce Owned by:
Milestone: 4.9 Priority: high
Severity: normal Version:
Component: Widgets Keywords: has-unit-tests has-patch commit
Focuses: Cc:

Description (last modified by westonruter)

Switching themes will cause widgets to be "lost" in theme switch. See this post for examples.

Related: #19912, which focuses on one specific solution — I'd like to see us step back from that and think about other ways to approach this problem.

Related: #39692, for the same problem with nav menus.

Related: #27404, Widget Customizer: Allow adding inactive widgets to widget areas

Change History (7)

#1 @melchoyce
12 months ago

Also related: #39692

#2 follow-up: @westonruter
12 months ago

  • Description modified (diff)
  • Milestone changed from Awaiting Review to 4.8

If we don't use the concept of a widget group (#19912), what's an alternative to what core currently does in trying to guess a sidebar to re-assign the widgets to? Add a user step to ask where they'd like widgets (and nav menus) to appear as an interstitial when doing a theme switch? That doesn't seem ideal either.

#3 follow-up: @SergeyBiryukov
12 months ago

Switching themes will cause widgets to be "lost" in theme switch.

This was previously fixed in #17979 for 3.3, sounds like there was a regression somewhere.

#4 in reply to: ↑ 2 @melchoyce
12 months ago

Replying to westonruter:

If we don't use the concept of a widget group (#19912), what's an alternative to what core currently does in trying to guess a sidebar to re-assign the widgets to? Add a user step to ask where they'd like widgets (and nav menus) to appear as an interstitial when doing a theme switch? That doesn't seem ideal either.

Some ideas:

  1. Throw all the widgets into whatever widget area there is without asking (and additionally make some design enhancements to make switching widget area easier)
  2. Look for similar widget area IDs/names to map to

It would also help to introduce the inactive widgets area into the Customizer.

#5 in reply to: ↑ 3 @melchoyce
12 months ago

Replying to SergeyBiryukov:

Switching themes will cause widgets to be "lost" in theme switch.

This was previously fixed in #17979 for 3.3, sounds like there was a regression somewhere.

If you go from many widget areas down to one widget area, you still "lose" widgets (in that they're set inactive, which, if you're working in the Customizer, doesn't exist). This ticket probably needs a better description.

This ticket was mentioned in Slack in #core-customize by melchoyce. View the logs.


12 months ago

#7 @westonruter
12 months ago

  • Description modified (diff)

To be worked on in conjunction with #27404.

Note: See TracTickets for help on using tickets.