In the customizer, whenever I add a new widget (but before I save/publish the changes) I would like to get the number of widgets in that sidebar area.
Once the changes have been saved and the widgets are saved to the DB, I can use the
wp_get_sidebars_widgets (called in the
init hook, where it registers my widgets) to count all the widgets for each sidebar area,
I've taken a look at the
wp.customize.Widgets and the
wp.customize.WidgetCustomizerPreview objects and they do not look like they will give me what I need. Where in the JS is this information saved?