Use a custom customizer section for add-widgets and add-menu-items panels, making this UI pattern reusable in plugins
|Reported by:||celloexpressions||Owned by:|
I've been thinking for a long time about how to make the add widgets/add menu items slide-out panel UI reusable for plugins. What if we restructure them as a custom section, with child section classes (or full-section custom controls) for widgets and menus that handle the actual UI?
In the case of widget and menus we would hide top-level UI from the panel and display it in every section (as it already is, likely just changing the button to invoke the custom section's expand method). For the base custom section that could be the UI of the section. There are several potential benefits to restructuring the menus and widgets code in the context of a section and control, in addition to finally abstracting the sliding frame UI for third party usage.
Note that the menus code originated as a copy-paste from widgets, so they should be similar enough to be abstracted off of a common base section, but there are discrepancies that have evolved over time.