WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Pelago\Emogrifier

CssInliner::inlineCss() public WC 1.0

Inlines the given CSS into the existing HTML.

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

Хуков нет.

Возвращает

self. fluent interface

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

$CssInliner = new CssInliner();
$CssInliner->inlineCss( $css );
$css(строка)
the CSS to inline, must be UTF-8-encoded
По умолчанию: ''

Код CssInliner::inlineCss() WC 4.5.2

woocommerce/vendor/pelago/emogrifier/src/Emogrifier/CssInliner.php
<?php
public function inlineCss($css = '')
{
    $this->clearAllCaches();
    $this->purgeVisitedNodes();

    $this->normalizeStyleAttributesOfAllNodes();

    $combinedCss = $css;
    // grab any existing style blocks from the HTML and append them to the existing CSS
    // (these blocks should be appended so as to have precedence over conflicting styles in the existing CSS)
    if ($this->isStyleBlocksParsingEnabled) {
        $combinedCss .= $this->getCssFromAllStyleNodes();
    }

    $cssWithoutComments = $this->removeCssComments($combinedCss);
    list($cssWithoutCommentsCharsetOrImport, $cssImportRules)
        = $this->extractImportAndCharsetRules($cssWithoutComments);

    $excludedNodes = $this->getNodesToExclude();
    $cssRules = $this->parseCssRules($cssWithoutCommentsCharsetOrImport);
    $cssSelectorConverter = $this->getCssSelectorConverter();
    foreach ($cssRules['inlinable'] as $cssRule) {
        try {
            $nodesMatchingCssSelectors = $this->xPath->query($cssSelectorConverter->toXPath($cssRule['selector']));
        } catch (SyntaxErrorException $e) {
            if ($this->debug) {
                throw $e;
            }
            continue;
        }

        /** @var \DOMElement $node */
        foreach ($nodesMatchingCssSelectors as $node) {
            if (\in_array($node, $excludedNodes, true)) {
                continue;
            }
            $this->copyInlinableCssToStyleAttribute($node, $cssRule);
        }
    }

    if ($this->isInlineStyleAttributesParsingEnabled) {
        $this->fillStyleAttributesWithMergedStyles();
    }

    $this->removeImportantAnnotationFromAllInlineStyles();

    $this->determineMatchingUninlinableCssRules($cssRules['uninlinable']);
    $this->copyUninlinableCssToStyleNode($cssImportRules);

    return $this;
}