Customizer: Properly handle widget settings when activating a previewed theme.

props westonruter, ocean90, gcorne.
fixes #27767.


git-svn-id: https://develop.svn.wordpress.org/trunk@28124 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2014-04-14 22:45:40 +00:00
parent b807ab4a34
commit a8efcb993f
5 changed files with 136 additions and 12 deletions

View File

@@ -942,6 +942,7 @@
params.action = 'update-widget';
params.wp_customize = 'on';
params.nonce = api.Widgets.data.nonce;
params.theme = api.settings.theme.stylesheet;
data = $.param( params );
$inputs = this._getInputs( $widgetContent );
@@ -1614,7 +1615,7 @@
widgetNumber = widget.get( 'multi_number' );
}
controlHtml = $( '#widget-tpl-' + widget.get( 'id' ) ).html();
controlHtml = $.trim( $( '#widget-tpl-' + widget.get( 'id' ) ).html() );
if ( widget.get( 'is_multi' ) ) {
controlHtml = controlHtml.replace( /<[^<>]+>/g, function( m ) {
return m.replace( /__i__|%i%/g, widgetNumber );