Automattic\WooCommerce\Vendor\Symfony\Component\CssSelector\XPath

Translator::addFunctionpublicWC 1.0

Method of the class: Translator{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Translator = new Translator();
$Translator->addFunction( $xpath, $function ): XPathExpr;
$xpath(XPathExpr) (required)
.
$function(FunctionNode) (required)
.

Translator::addFunction() code WC 10.4.3

public function addFunction(XPathExpr $xpath, FunctionNode $function): XPathExpr
{
    if (!isset($this->functionTranslators[$function->getName()])) {
        throw new ExpressionErrorException(sprintf('Function "%s" not supported.', $function->getName()));
    }

    return $this->functionTranslators[$function->getName()]($xpath, $function);
}