Opened 8 years ago
Closed 8 years ago
#43063 closed enhancement (wontfix)
wp customizer is missing core events
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.9.1 |
| Component: | Customize | Keywords: | |
| Focuses: | javascript | Cc: |
Description
Hi,
Won't it be nice if we could use events like "menu-item-added", "widget-added" or like "widget-updated" events in the customizer too? I'm currently using "pane-contents-reflowed" or "state.change" events to handle such things.
Change History (1)
Note: See
TracTickets for help on using
tickets.
You can listen for controls being added via
wp.customize.control.bind( 'add', function( control ) { /* ... */ } )So just check if
control.idbegins withwidget_ornav_menu_itemand that will tell you when a menu item or widget is added.