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

Pelago

Emogrifier::removeImportantAnnotationFromNodeInlineStyle() private WC 1.0

Removes the "!important" annotations out of the inline style declarations, eventually by rearranging declarations. Rearranging needed when !important shorthand properties are followed by some of their not !important expanded-version properties. For example "font: 12px serif !important; font-size: 13px;" must be reordered to "font-size: 13px; font: 12px serif;" in order to remain correct.

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

Хуков нет.

Возвращает

null. Ничего.

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

// private - только в коде основоного (родительского) класса
$result = $this->removeImportantAnnotationFromNodeInlineStyle( \DOMElement $node );
\DOMElement $node (обязательный)
-

Код Emogrifier::removeImportantAnnotationFromNodeInlineStyle() WC 5.4.1

<?php
private function removeImportantAnnotationFromNodeInlineStyle(\DOMElement $node)
{
    $inlineStyleDeclarations = $this->parseCssDeclarationsBlock($node->getAttribute('style'));
    $regularStyleDeclarations = [];
    $importantStyleDeclarations = [];
    foreach ($inlineStyleDeclarations as $property => $value) {
        if ($this->attributeValueIsImportant($value)) {
            $importantStyleDeclarations[$property] = \trim(\str_replace('!important', '', $value));
        } else {
            $regularStyleDeclarations[$property] = $value;
        }
    }
    $inlineStyleDeclarationsInNewOrder = \array_merge(
        $regularStyleDeclarations,
        $importantStyleDeclarations
    );
    $node->setAttribute(
        'style',
        $this->generateStyleStringFromSingleDeclarationsArray($inlineStyleDeclarationsInNewOrder)
    );
}