0

Where can I find the core code for the Menu customizer panel?

I want to do something that looks almost exactly like that, so I want to rely on the core code for it (I want to create a panel in which by clicking a button, new sections will be added to the panel).

0

The logic to dynamically add new sections is pretty straightforward with the JS API (and will be even more so in the upcoming 4.9 release).

For dynamically adding new nav menu sections, see the relevant logic in wp.customize.Menus.NewMenuControl.prototype.submit.

Another example you can refer to is in the Customize Posts plugin which adds sections dynamically for each post or page being edited. See wp.customize.Posts.addPostSection and then see the source for wp.customize.Posts.PostSection.

Lastly, see my previous answer for how to create a button control.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.