WordPress.org

Make WordPress Core

Changeset 28100


Ignore:
Timestamp:
04/13/2014 04:40:07 PM (6 years ago)
Author:
nacin
Message:

Customizer: Account for a sidebar with no container to which classes can be added.

props ocean90.
fixes #27780.

File:
1 edited

Legend:

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

    r27985 r28100  
    5151                emptyWidget = $(widgetTpl);
    5252                widgetSelector = emptyWidget.prop('tagName');
    53                 widgetClasses = emptyWidget.prop('className').replace(/^\s+|\s+$/g, '');
     53                widgetClasses = emptyWidget.prop('className');
     54
     55                // Prevent a rare case when before_widget, before_title, after_title and after_widget is empty.
     56                if ( ! widgetClasses ) {
     57                    return;
     58                }
     59
     60                widgetClasses = widgetClasses.replace(/^\s+|\s+$/g, '');
    5461
    5562                if ( widgetClasses ) {
Note: See TracChangeset for help on using the changeset viewer.