[wp-trac] [WordPress Trac] #22118: wp_customize_support_script() concatenates class names, breaking CSS

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 6 18:04:16 UTC 2012


#22118: wp_customize_support_script() concatenates class names, breaking CSS
--------------------------+------------------------
 Reporter:  beaulebens    |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Themes        |     Version:
 Severity:  normal        |  Resolution:  duplicate
 Keywords:  has-patch     |
--------------------------+------------------------
Description changed by SergeyBiryukov:

Old description:

> When wp_customize_support_script() runs, it removes 'no-customize-
> support' from the list of classes applied to the body tag.
>
> The regular expression used to match that class includes whitespace
> either side of the class name, and then replaces the entire thing with
> ''.
>
> This results in concatenation of any previously-adjacent classes, which
> in turn can leave you with a body class looking something like this:
>
> `home blog logged-in admin-barcustom-background default-menu no-
> customize-support debug-bar-maximized customize-support`
>
> Note: `admin-barcustom-background`, which breaks any CSS applied to
> either of those classes.
>
> Instead of replacing with '', just replace with ' ', which will leave a
> space and thus leave both classes being valid.

New description:

 When wp_customize_support_script() runs, it removes 'no-customize-support'
 from the list of classes applied to the body tag.

 The regular expression used to match that class includes whitespace either
 side of the class name, and then replaces the entire thing with `''`.

 This results in concatenation of any previously-adjacent classes, which in
 turn can leave you with a body class looking something like this:

 `home blog logged-in admin-barcustom-background default-menu no-customize-
 support debug-bar-maximized customize-support`

 Note: `admin-barcustom-background`, which breaks any CSS applied to either
 of those classes.

 Instead of replacing with `''`, just replace with `' '`, which will leave
 a space and thus leave both classes being valid.

--

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22118#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list