Customize: Prevent widget previewing logic from building invalid jQuery selectors when sidebars are registered without a class name in before_widget
.
Fixes #37993. git-svn-id: https://develop.svn.wordpress.org/trunk@38577 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b875264a73
commit
8bae522ea8
@ -537,7 +537,9 @@ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function(
|
||||
// Remove class names that incorporate the string formatting placeholders %1$s and %2$s.
|
||||
widgetClasses = widgetClasses.replace( /\S*%[12]\$s\S*/g, '' );
|
||||
widgetClasses = widgetClasses.replace( /^\s+|\s+$/g, '' );
|
||||
if ( widgetClasses ) {
|
||||
widgetSelector += '.' + widgetClasses.split( /\s+/ ).join( '.' );
|
||||
}
|
||||
self.widgetSelectors.push( widgetSelector );
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user