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


Emogrifier::process() protected WC 1.0

Applies $this->css to $this->domDocument.

This method places the CSS inline.

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

Хуков нет.


null. Ничего.


// protected - в коде основоного (родительского) или дочернего класса
$result = $this->process();

Код Emogrifier::process() WC 5.4.1

protected function process()

    \set_error_handler([$this, 'handleXpathQueryWarnings'], E_WARNING);

    // 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)
    $allCss = $this->css;
    if ($this->isStyleBlocksParsingEnabled) {
        $allCss .= $this->getCssFromAllStyleNodes();

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

    $excludedNodes = $this->getNodesToExclude();
    $cssRules = $this->parseCssRules($cssWithoutCommentsCharsetOrImport);
    foreach ($cssRules['inlinable'] as $cssRule) {
        // There's no real way to test "PHP Warning" output generated by the following XPath query unless PHPUnit
        // converts it to an exception. Unfortunately, this would only apply to tests and not work for production
        // executions, which can still flood logs/output unnecessarily. Instead, Emogrifier's error handler should
        // always throw an exception and it must be caught here and only rethrown if in debug mode.
        try {
            // \DOMXPath::query will always return a DOMNodeList or throw an exception when errors are caught.
            $nodesMatchingCssSelectors = $this->xPath->query($this->translateCssToXpath($cssRule['selector']));
        } catch (\InvalidArgumentException $e) {
            if ($this->debug) {
                throw $e;

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

    if ($this->isInlineStyleAttributesParsingEnabled) {


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