WordPress.org

Make WordPress Core

Changeset 38577


Ignore:
Timestamp:
09/08/16 15:44:08 (9 months ago)
Author:
westonruter
Message:

Customize: Prevent widget previewing logic from building invalid jQuery selectors when sidebars are registered without a class name in before_widget.

Fixes #37993.

File:
1 edited

Legend:

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

    r38166 r38577  
    538538            widgetClasses = widgetClasses.replace( /\S*%[12]\$s\S*/g, '' ); 
    539539            widgetClasses = widgetClasses.replace( /^\s+|\s+$/g, '' ); 
    540             widgetSelector += '.' + widgetClasses.split( /\s+/ ).join( '.' ); 
     540            if ( widgetClasses ) { 
     541                widgetSelector += '.' + widgetClasses.split( /\s+/ ).join( '.' ); 
     542            } 
    541543            self.widgetSelectors.push( widgetSelector ); 
    542544        }); 
Note: See TracChangeset for help on using the changeset viewer.