mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-25 13:44:30 +00:00
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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user