Automattic\WooCommerce\EmailEditorVendor\Pelago\Emogrifier

CssInliner::removeUnsupportedOfTypePseudoClasses │ private │ WC 1.0

Removes any ...-of-type pseudo-classes from part of a CSS selector, if it does not have a type, replacing them with "*" if necessary.

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

Хуков нет.

Возвращает

string. selector part which will match the relevant DOM elements if the pseudo-classes are assumed to apply

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

// private - только в коде основоного (родительского) класса
$result = $this->removeUnsupportedOfTypePseudoClasses( $selectorPart ): string;
$selectorPart(строка) (обязательный)
part of a selector which has been split up at combinators.

Код CssInliner::removeUnsupportedOfTypePseudoClasses() WC 11.3.0

private function removeUnsupportedOfTypePseudoClasses(string $selectorPart): string
{
    if (!$this->selectorPartHasUnsupportedOfTypePseudoClass($selectorPart)) {
        return $selectorPart;
    }

    return $this->removeSelectorComponents(
        ':(?:' . self::OF_TYPE_PSEUDO_CLASS_MATCHER . ')(?:\\([^\\)]*+\\))?+',
        $selectorPart
    );
}