Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#22103 closed defect (bug) (fixed)

wp_customize_support_script() removes spaces separating classes

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

Description

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 12 years ago.
Leave spaces intact
22103.2.patch (409 bytes) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (8)

@johnpbloch
12 years ago

Leave spaces intact

#1 @DrewAPicture
12 years ago

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

#2 @SergeyBiryukov
12 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.

#3 @DrewAPicture
12 years ago

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

#4 @DrewAPicture
12 years ago

  • Keywords commit added

per @nacin in IRC

#5 @SergeyBiryukov
12 years ago

#22118 was marked as a duplicate.

#2 @duck_
12 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.