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

Pelago

Emogrifier::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.

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

Хуков нет.

Возвращает

Строку. 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(строка) (обязательный)
-

Код Emogrifier::removeUnmatchablePseudoComponents() WC 5.4.1

<?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
    );
}