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

Pelago\Emogrifier

CssInliner::getCssRuleMatches() private WC 1.0

Parses a string of CSS into the media query, selectors and declarations for each ruleset in order.

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

Хуков нет.

Возвращает

Строку[][]. Array of string sub-arrays with the keys "media" (the media query string, e.g. "@media screen and (max-width: 480px)", or an empty string if not from an @media rule), "selectors" (the CSS selector(s), e.g., "*" or "h1, h2"), "declarations" (the semicolon-separated CSS declarations for that/those selector(s), e.g., "color: red; height: 4px;"),

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

// private - только в коде основоного (родительского) класса
$result = $this->getCssRuleMatches( $css );
$css(строка) (обязательный)
CSS with comments removed

Код CssInliner::getCssRuleMatches() WC 4.5.2

woocommerce/vendor/pelago/emogrifier/src/Emogrifier/CssInliner.php
<?php
private function getCssRuleMatches($css)
{
    $splitCss = $this->splitCssAndMediaQuery($css);

    $ruleMatches = [];
    foreach ($splitCss as $cssPart) {
        // process each part for selectors and definitions
        \preg_match_all('/(?:^|[\\s^{}]*)([^{]+){([^}]*)}/mi', $cssPart['css'], $matches, PREG_SET_ORDER);

        /** @var string[][] $matches */
        foreach ($matches as $cssRule) {
            $ruleMatches[] = [
                'media' => $cssPart['media'],
                'selectors' => $cssRule[1],
                'declarations' => $cssRule[2],
            ];
        }
    }

    return $ruleMatches;
}