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


Emogrifier::extractImportAndCharsetRules() private WC 1.0

Extracts @import and @charset rules from the supplied CSS. These rules must not be preceded by any other rules, or they will be ignored. (From the CSS 2.1 specification: "CSS 2.1 user agents must ignore any '@import' rule that occurs inside a block or after any non-ignored statement other than an @charset or an @import rule." Note also that @charset is case sensitive whereas @import is not.)

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

Хуков нет.


Строку[]. The first element is the CSS with the valid @import and @charset rules removed. The second element contains a concatenation of the valid @import rules, each followed by whatever whitespace followed it in the original CSS (so that either unminified or minified formatting is preserved); if there were no @import rules, it will be an empty string. The (valid) @charset rules are discarded.


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

Код Emogrifier::extractImportAndCharsetRules() WC 5.4.1

private function extractImportAndCharsetRules($css)
    $possiblyModifiedCss = $css;
    $importRules = '';

    while (
    ) {
        list($fullMatch, $atRuleAndFollowingWhitespace, $atRuleName) = $matches;

        if (\strtolower($atRuleName) === 'import') {
            $importRules .= $atRuleAndFollowingWhitespace;

        $possiblyModifiedCss = \substr($possiblyModifiedCss, \strlen($fullMatch));

    return [$possiblyModifiedCss, $importRules];