WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 5 months ago

#40057 new defect (bug)

Double hashed value for background-color of body.background-color

Reported by: hovhanneshovakimyan Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7.3
Component: Themes Keywords:
Focuses: Cc:

Description

The problem is that body.custom-background has background-color property which gets double hashed value.

So if theme is supporting custom background features, then you'll get wrong (double hashed) background-color value all the time.

I have already found the cause of the problem.

Check this file:

wp-includes/theme.php

on line: 1564

change this:

$style = $color ? "background-color: #$color;" : ;

to this:

$style = $color ? "background-color: $color;" : ;

That will solve the problem.

Change History (1)

#1 @joyously
5 months ago

This still exists in 5.1, although it's only a problem if the theme tries to handle the color separately.

Possible fix (line 1633 of theme.php from 5.1):
$style = $color ? 'background-color: ' . maybe_hash_hex_color( $color ) . ';' : '';

Note: See TracTickets for help on using tickets.