WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 7 months ago

#37993 closed defect (bug) (fixed)

jQuery Syntax Error when not adding a class in 'before_widget'

Reported by: acosmin Owned by: westonruter
Milestone: 4.7 Priority: normal
Severity: normal Version: 3.9
Component: Customize Keywords:
Focuses: Cc:

Description

If you remove the widget class (or if you don't add a class) in 'before_widget' => '<section id="%1$s" class="widget %2$s">', when using register_sidebar() you get a jQuery Syntax Error in the Customizer.

jquery.js?ver=1.12.4:2 Uncaught Error: Syntax error, unrecognized expression: SECTION.,SECTION.widget,SECTION.widget

Change History (2)

#1 @westonruter
7 months ago

  • Milestone changed from Awaiting Review to 4.7
  • Owner set to westonruter
  • Status changed from new to accepted
  • Version changed from 4.6 to 3.9

Related: #37993

#2 @westonruter
7 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 38577:

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

Fixes #37993.

Note: See TracTickets for help on using tickets.