Add Widget Groups and Locations
|Reported by:||koopersmith||Owned by:|
|Cc:||scribu, sabreuse@…, rfair404, marko@…, navjotjsingh@…, eddie.moya+wptrac@…, bobbravo2|
Currently, if a widget cannot be properly matched to a sidebar when switching themes, it is moved to the "Inactive widgets" section (debated for quite a while here: #17979).
With the addition of the planned appearance improvements, it would be nice if we could let the user manipulate widgets as a group. Instead of trying to be too clever, we can let the user review where the widgets are positioned in their theme.
Conceptually, this is very similar to how nav menu locations currently operate. Menu items are grouped in menus (created by the user), which can be assigned to menu locations (created by the theme). Likewise, widgets would be organized into groups (created by the user), and could be assigned to widget locations (created by the theme). Currently, "widget areas" are on double-duty — they act as both "widget groups" and "widget locations".
I think the first step is to add the concept of "widget groups" into the current API and turn the existing "widget areas" into locations mapped to these groups.
If we're looking to compartmentalize the patches, these initial changes could initially be added without modifying the widgets UI. Instead, we could temporarily link a widget group to a widget area behind the scenes. That said, the benefits could only be fully realized with a few tweaks to the widgets UI.