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

Pelago\Emogrifier

CssInliner::removeUnmatchablePseudoComponents() private WC 1.0

Removes pseudo-elements and dynamic pseudo-classes from a CSS selector, replacing them with "*" if necessary. If such a pseudo-component is within the argument of :not, the entire :not component is removed or replaced.

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

Хуков нет.

Возвращает

Строку. Selector which will match the relevant DOM elements if the pseudo-classes are assumed to apply, or in the case of pseudo-elements will match their originating element.

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

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

Код CssInliner::removeUnmatchablePseudoComponents() WC 4.5.2

woocommerce/vendor/pelago/emogrifier/src/Emogrifier/CssInliner.php
<?php
private function removeUnmatchablePseudoComponents($selector)
{
    // The regex allows nested brackets via `(?2)`.
    // A space is temporarily prepended because the callback can't determine if the match was at the very start.
    $selectorWithoutNots = \ltrim(\preg_replace_callback(
        '/(\\s?+):not(\\([^()]*+(?:(?2)[^()]*+)*+\\))/i',
        [$this, 'replaceUnmatchableNotComponent'],
        ' ' . $selector
    ));

    $pseudoComponentMatcher = ':(?!' . self::PSEUDO_CLASS_MATCHER . '):?+[\\w\\-]++(?:\\([^\\)]*+\\))?+';
    return \preg_replace(
        ['/(\\s|^)' . $pseudoComponentMatcher . '/i', '/' . $pseudoComponentMatcher . '/i'],
        ['$1*', ''],
        $selectorWithoutNots
    );
}