WordPress at Your Fingertips
function is not described


CssToAttributeConverter::mapSimpleCssProperty() private WC 1.0

Looks up the CSS property in the mapping table and maps it if it matches the conditions.

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

No Hooks.


true|false. true if the property can be mapped using the simple mapping table


// private - for code of main (parent) class only
$result = $this->mapSimpleCssProperty( $property, $value, $node );
$property(string) (required)
the name of the CSS property to map
$value(string) (required)
the value of the style rule to map
$node(DOMElement) (required)
node to apply styles to

Code of CssToAttributeConverter::mapSimpleCssProperty() WC 5.5.2

private function mapSimpleCssProperty($property, $value, \DOMElement $node)
    if (!isset($this->cssToHtmlMap[$property])) {
        return false;

    $mapping = $this->cssToHtmlMap[$property];
    $nodesMatch = !isset($mapping['nodes']) || \in_array($node->nodeName, $mapping['nodes'], true);
    $valuesMatch = !isset($mapping['values']) || \in_array($value, $mapping['values'], true);
    $canBeMapped = $nodesMatch && $valuesMatch;
    if ($canBeMapped) {
        $node->setAttribute($mapping['attribute'], $value);

    return $canBeMapped;