[wp-trac] [WordPress Trac] #39693: Fix missing assignment of widgets on theme switch

WordPress Trac noreply at wordpress.org
Mon Feb 6 13:46:07 UTC 2017


#39693: Fix missing assignment of widgets on theme switch
-------------------------+------------------
 Reporter:  melchoyce    |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.8
Component:  Widgets      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------

Comment (by folletto):

 > It seems like #19912 is still the best long term approach here.

 I back @westonruter's
 [https://core.trac.wordpress.org/ticket/19912#comment:25 comment] as that
 ticket being more about the technical consolidation as separate from the
 UI, as menu locations is one of the most confusing interface concepts
 ever. I tried to explore alternatives on .com, but it didn't work very
 well. Unless we have a solid solution, I wouldn't introduce UI for it.

 Regardless, I agree with you:

 > This ticket would be a good place to explore additional ways to automate
 widget assignments, both with and without the concept of widget groups.

 As re-assignment is a big win regardless of the decision on the other
 ticket, I think groups could play into this as a way to achieve solid
 switching.

 I'd use a logic similar as Mel outlined in #39692:

 > If your old theme only has one menu and your new theme only has one
 menu, just map them automatically
 > If your old theme and new theme share a similar IDs or names, map them
 automatically
 > If your old theme has more than one menu, or your new theme has more
 than one menu, map the menu in the first menu location in your old theme
 to the first menu location in the new theme.

 Another way to say it: always associate the maximum number of existing
 items to the most likely location.
 Since here we deal with individual widget and not menus, it's probably
 going to be trickier.

 The extra considerations I'll do for both are:

 1. We need to make sure that when a user switches back to a previous theme
 the items relocate to exactly the same location. I'm not sure how this can
 be done, but it's very important as it's expected.
 2. In case of a switch to a theme with less locations, there should be a
 good default so ideally the user has as little as possible extra work to
 do.
 3. Previous widget configurations should be able to be retained in a way
 to be explored.

 We need to explore how to make "dropped" widgets accessible to not make
 people lose the configuration they made.

 One idea: as a different theme might have different areas, an idea would
 be to introduce a section inside the "Add widget" panel that lists
 previous configurations. In that way one can "Add" a pre-configured widget
 (or delete that pre-configuration), without introducing an additional
 concept of "an inactive widget area".

 Incidentally providing an API to pre-configured widget could be a feature
 for multi-site installation too where there are some pre-configured
 templates provided at network level. But this escalates complexity, I'm
 throwing it in just as a potential vision.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39693#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list