Theme Customizer – How to create a sub panel

In Theme Customizer, i’d like to create a sub panel like this one of wordpress:
Theme Customizer SubPanel

When we add a new item, a new panel which allows us to pick up a item displays on the right, how can i do the same ?

Thank you !

1 Answer
1

This slide-out panel for picking a widget or nav menu item to add is specific to the implementations of Widgets and Nav Menus in the Customizer. There is no generic facility for adding this UI feature, so I suggest looking at Core to look at how it is implemented there to copy into your plugin. For nav menus, see the AvailableMenuItemsPanelView JS and the corresponding CSS:

https://core.trac.wordpress.org/browser/tags/4.4.1/src/wp-admin/js/customize-nav-menus.js#L92
https://core.trac.wordpress.org/browser/tags/4.4.1/src/wp-admin/css/customize-nav-menus.css#L557

Leave a Comment