WordPress at a glance
function is not described


CssSelectorConverter::toXPath() public WC 1.0

Translates a CSS expression to its XPath equivalent.

Optionally, a prefix can be added to the resulting XPath expression with the $prefix parameter.

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

No Hooks.


String. Nothing.


$CssSelectorConverter = new CssSelectorConverter();
$CssSelectorConverter->toXPath( $cssExpr, $prefix );
$cssExpr(string) (required)
The CSS expression
An optional prefix for the XPath expression

Code of CssSelectorConverter::toXPath() WC 5.4.1

public function toXPath($cssExpr, $prefix = 'descendant-or-self::')
    return $this->translator->cssToXPath($cssExpr, $prefix);