WordPress at a glance
function is not described

Symfony\Component\CssSelector\XPath\Extension

AttributeMatchingExtension::translateDashMatch() public WC 1.0

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

No Hooks.

Return

XPathExpr.

Usage

$AttributeMatchingExtension = new AttributeMatchingExtension();
$AttributeMatchingExtension->translateDashMatch( $xpath, $attribute, $value );
$xpath(XPathExpr) (required)
-
$attribute(string) (required)
-
$value(string) (required)
-

Code of AttributeMatchingExtension::translateDashMatch() WC 5.4.1

<?php
public function translateDashMatch(XPathExpr $xpath, $attribute, $value)
{
    return $xpath->addCondition(sprintf(
        '%1$s and (%1$s = %2$s or starts-with(%1$s, %3$s))',
        $attribute,
        Translator::getXpathLiteral($value),
        Translator::getXpathLiteral($value.'-')
    ));
}