Automattic\WooCommerce\Vendor\Pelago\Emogrifier

CssInliner::getCssFromAllStyleNodesprivateWC 1.0

Returns CSS content.

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

Хуков нет.

Возвращает

Строку.

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

// private - только в коде основоного (родительского) класса
$result = $this->getCssFromAllStyleNodes(): string;

Код CssInliner::getCssFromAllStyleNodes() WC 10.4.3

private function getCssFromAllStyleNodes(): string
{
    $styleNodes = $this->getXPath()->query('//style');
    if ($styleNodes === false) {
        return '';
    }

    $css = '';
    foreach ($styleNodes as $styleNode) {
        if (\is_string($styleNode->nodeValue)) {
            $css .= "\n\n" . $styleNode->nodeValue;
        }
        $parentNode = $styleNode->parentNode;
        if ($parentNode instanceof \DOMNode) {
            $parentNode->removeChild($styleNode);
        }
    }

    return $css;
}