diff --git a/src/wp-includes/js/customize-preview-widgets.js b/src/wp-includes/js/customize-preview-widgets.js index 92267e88fb..f9828295fc 100644 --- a/src/wp-includes/js/customize-preview-widgets.js +++ b/src/wp-includes/js/customize-preview-widgets.js @@ -2,8 +2,7 @@ if ( ! wp || ! wp.customize ) { return; } - var api = wp.customize, - OldPreview; + var api = wp.customize; /** * wp.customize.WidgetCustomizerPreview @@ -20,6 +19,8 @@ init: function () { var self = this; + + this.preview = api.preview; this.buildWidgetSelectors(); this.highlightControls(); @@ -104,17 +105,6 @@ } }; - /** - * Capture the instance of the Preview since it is private - */ - OldPreview = api.Preview; - api.Preview = OldPreview.extend( { - initialize: function( params, options ) { - api.WidgetCustomizerPreview.preview = this; - OldPreview.prototype.initialize.call( this, params, options ); - } - } ); - $(function () { var settings = window._wpWidgetCustomizerPreviewSettings; if ( ! settings ) {