WordPress at a glance
function is not described


CssInliner::existsMatchForCssSelector() private WC 1.0

Checks whether there is at least one matching element for $cssSelector. When not in debug mode, it returns true also for invalid selectors (because they may be valid, just not implemented/recognized yet by Emogrifier).

{} It's a method of the class: CssInliner{}

No Hooks.




// private - for code of main (parent) class only
$result = $this->existsMatchForCssSelector( $cssSelector );
$cssSelector(string) (required)

Code of CssInliner::existsMatchForCssSelector() WC 5.0.0

private function existsMatchForCssSelector($cssSelector)
    try {
        $nodesMatchingSelector = $this->xPath->query($this->getCssSelectorConverter()->toXPath($cssSelector));
    } catch (SyntaxErrorException $e) {
        if ($this->debug) {
            throw $e;
        return true;

    return $nodesMatchingSelector !== false && $nodesMatchingSelector->length !== 0;