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

AttributeMatchingExtension::translatePrefixMatchpublicWC 1.0

Method of the class: AttributeMatchingExtension{}

No Hooks.

Returns

null. Nothing (null).

Usage

$AttributeMatchingExtension = new AttributeMatchingExtension();
$AttributeMatchingExtension->translatePrefixMatch( $xpath, $attribute, ?string $value ): XPathExpr;
$xpath(XPathExpr) (required)
.
$attribute(string) (required)
.
?string $value(required)
.

AttributeMatchingExtension::translatePrefixMatch() code WC 10.5.0

public function translatePrefixMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr
{
    return $xpath->addCondition($value ? sprintf(
        '%1$s and starts-with(%1$s, %2$s)',
        $attribute,
        Translator::getXpathLiteral($value)
    ) : '0');
}