Automattic\WooCommerce\EmailEditorVendor\Pelago\Emogrifier\HtmlProcessor

CssToAttributeConverter::convertCssToVisualAttributes │ public │ WC 1.0

Maps the CSS from the style nodes to visual HTML attributes.

Метод класса: CssToAttributeConverter{}

Хуков нет.

Возвращает

$this.

Использование

$CssToAttributeConverter = new CssToAttributeConverter();
$CssToAttributeConverter->convertCssToVisualAttributes(): self;

Код CssToAttributeConverter::convertCssToVisualAttributes() WC 11.3.0

public function convertCssToVisualAttributes(): self
{
    $declarationBlockParser = new DeclarationBlockParser();
    /** @var \DOMElement $node */
    foreach ($this->getAllNodesWithStyleAttribute() as $node) {
        $inlineStyleDeclarations = $declarationBlockParser->parse($node->getAttribute('style'));
        $this->mapCssToHtmlAttributes($inlineStyleDeclarations, $node);
    }

    return $this;
}