WordPress.org

Make WordPress Core

Changeset 30308


Ignore:
Timestamp:
11/11/2014 10:45:47 PM (6 years ago)
Author:
ocean90
Message:

Customizer: Trigger widget-added event when initializing.

Widget controls are now added to the pane dynamically via JavaScript, see #28709.
Remove the event trigger from SidebarControl.addWidget() as it's covered by WidgetControl.ready().

props westonruter.
fixes #30236.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-widgets.js

    r30307 r30308  
    435435            this._setupUpdateUI();
    436436            this._setupRemoveUI();
     437
     438            /*
     439             * Trigger widget-added event so that plugins can attach any event
     440             * listeners and dynamic UI elements.
     441             */
     442            $( document ).trigger( 'widget-added', [ this.container.find( '.widget:first' ) ] );
    437443        },
    438444
     
    18071813            } );
    18081814
    1809             $( document ).trigger( 'widget-added', [ $widget ] );
    1810 
    18111815            return widgetFormControl;
    18121816        }
Note: See TracChangeset for help on using the changeset viewer.