Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#22103 closed defect (bug) (fixed)

wp_customize_support_script() removes spaces separating classes

Reported by: johnpbloch Owned by: duck_
Milestone: 3.5 Priority: normal
Severity: major Version: 3.5
Component: Customize Keywords: has-patch commit
Focuses: Cc:


When 'no-customize-support' is removed from the body classes via javascript, the surrounding spaces are also removed. When the class was in the middle of the body class (in my case, between admin-bar and custom-background, the surrounding classes get mashed together (e.g. admin-barcustom-background). Patch to follow.

Attachments (2)

22103.patch (449 bytes) - added by johnpbloch 3 years ago.
Leave spaces intact
22103.2.patch (409 bytes) - added by SergeyBiryukov 3 years ago.

Download all attachments as: .zip

Change History (8)

@johnpbloch3 years ago

Leave spaces intact

comment:1 @DrewAPicture3 years ago

Related: #20896 - Theme Customizer: Add "no-customize-support" class to the body tag by default

@SergeyBiryukov3 years ago

comment:2 @SergeyBiryukov3 years ago

  • Component changed from General to Appearance
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.5
  • Severity changed from normal to major

Confirmed. [22107] made it more prominent.

To reproduce, just set a custom background and visit the site. The custom background will only be displayed for a fraction of a second until wp_customize_support_script() runs.

A single space in line 1689 seems enough.

comment:3 @DrewAPicture3 years ago

22103.2.patch Works for me. This was also wreaking havoc with custom-backgrounds not applying correctly.

comment:4 @DrewAPicture3 years ago

  • Keywords commit added

per @nacin in IRC

comment:5 @SergeyBiryukov3 years ago

#22118 was marked as a duplicate.

comment:2 @duck_3 years ago

  • Owner set to duck_
  • Resolution set to fixed
  • Status changed from new to closed

In [22132]:

Prevent accidental body class concatenation by replacing (no-)customize-support with a space

The regular expression used by wp_customize_support_script() replaces all spaces
surrounding the matching class. This caused other classes to be merged together.

Props johnpbloch, SergeyBiryukov. Fixes #22103.

Note: See TracTickets for help on using tickets.