WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 3 months 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)

#1 @westonruter
3 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

You can listen for controls being added via wp.customize.control.bind( 'add', function( control ) { /* ... */ } )

So just check if control.id begins with widget_ or nav_menu_item and that will tell you when a menu item or widget is added.

Note: See TracTickets for help on using tickets.