WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 8 days ago

#36733 new enhancement

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:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.9
Component: Customize Keywords: needs-patch dev-feedback
Focuses: Cc:

Description

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.

Change History (5)

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


3 years ago

#4 @celloexpressions
6 months ago

  • Milestone set to Future Release

I still recommend abstracting this UI pattern into something reusable, in the spirit of the customize API philosophy. If the block editor or use of blocks for widgets makes any major changes to this implementation, then the abstraction should happen with that process. Otherwise, the abstraction should happen as was the original intent with the customize menus feature, but not something that resources allowed for with that feature's development.

#5 @celloexpressions
6 months ago

  • Milestone changed from Future Release to 5.3

Milestoning to coincide with potential incorporation of blocks into widgets in core for visibility and further review, as most working on those features are likely unaware of the history and context here. Please review the customize component tickets and make core posts relating to the original incorporation of widgets (in 3.9) and menus (in 4.3) for additional information and ping me if there are any specific questions on the original design intent and roadmaps.

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


8 days ago

#7 @davidbaumwald
8 days ago

  • Keywords dev-feedback added
  • Milestone changed from 5.3 to Future Release

This ticket was discussed in today's Bug Scrub. Since this is an enhancement without a patch, and is related to features slated to land in 5.3, this is being moved to Future Release. Also adding dev-feedback to generate some more discussion about implementation.

Note: See TracTickets for help on using tickets.