Automattic\WooCommerce\Vendor\Symfony\Component\CssSelector\XPath\Extension
AttributeMatchingExtension::translateDashMatch
Method of the class: AttributeMatchingExtension{}
No Hooks.
Returns
null. Nothing (null).
Usage
$AttributeMatchingExtension = new AttributeMatchingExtension(); $AttributeMatchingExtension->translateDashMatch( $xpath, $attribute, ?string $value ): XPathExpr;
- $xpath(XPathExpr) (required)
- .
- $attribute(string) (required)
- .
- ?string $value(required)
- .
AttributeMatchingExtension::translateDashMatch() AttributeMatchingExtension::translateDashMatch code WC 10.4.3
public function translateDashMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr
{
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.'-')
));
}