Opened 7 years ago
Closed 7 years ago
#43063 closed enhancement (wontfix)
wp customizer is missing core events
Reported by: | tpaksu | 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.id
begins withwidget_
ornav_menu_item
and that will tell you when a menu item or widget is added.