Automattic\WooCommerce\Vendor\Symfony\Component\CssSelector
CssSelectorConverter::toXPath
Translates a CSS expression to its XPath equivalent.
Optionally, a prefix can be added to the resulting XPath expression with the $prefix parameter.
Method of the class: CssSelectorConverter{}
No Hooks.
Returns
String.
Usage
$CssSelectorConverter = new CssSelectorConverter(); $CssSelectorConverter->toXPath( $cssExpr, $prefix );
- $cssExpr(string) (required)
- .
- $prefix(string)
- .
Default:'descendant-or-self::'
CssSelectorConverter::toXPath() CssSelectorConverter::toXPath code WC 10.7.0
public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::')
{
return $this->cache[$prefix][$cssExpr] ?? $this->cache[$prefix][$cssExpr] = $this->translator->cssToXPath($cssExpr, $prefix);
}