Automattic\WooCommerce\Vendor\Pelago\Emogrifier

CssInliner::existsMatchForSelectorInCssRule │ private │ WC 1.0

Checks whether there is at least one matching element for the CSS selector contained in the selector element of the provided CSS rule.

Any dynamic pseudo-classes will be assumed to apply. If the selector matches a pseudo-element, it will test for a match with its originating element.

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

Хуков нет.

Возвращает

bool.

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

// private - только в коде основоного (родительского) класса
$result = $this->existsMatchForSelectorInCssRule( $cssRule ): bool;
$cssRule *(array{
media: string,
selector: string,
hasUnmatchablePseudo: bool,
declarationsBlock: string,
line: int
}) (обязательный)*
.

Код CssInliner::existsMatchForSelectorInCssRule() WC 11.2.1

private function existsMatchForSelectorInCssRule(array $cssRule): bool
{
    $selector = $cssRule['selector'];
    if ($cssRule['hasUnmatchablePseudo']) {
        $selector = $this->removeUnmatchablePseudoComponents($selector);
    }
    return $this->existsMatchForCssSelector($selector);
}