WordPress at a glance
function is not described

Pelago\Emogrifier\HtmlProcessor

CssToAttributeConverter::mapBackgroundProperty() private WC 1.0

{} It's a method of the class: CssToAttributeConverter{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->mapBackgroundProperty( \DOMElement $node, $value );
\DOMElement $node (required)
-
$value(string) (required)
the value of the style rule to map

Code of CssToAttributeConverter::mapBackgroundProperty() WC 5.4.1

<?php
private function mapBackgroundProperty(\DOMElement $node, $value)
{
    // parse out the color, if any
    $styles = \explode(' ', $value, 2);
    $first = $styles[0];
    if (\is_numeric($first[0]) || \strncmp($first, 'url', 3) === 0) {
        return;
    }

    // as this is not a position or image, assume it's a color
    $node->setAttribute('bgcolor', $first);
}