Automattic\WooCommerce\Vendor\Symfony\Component\CssSelector\XPath\Extension
AttributeMatchingExtension::translateSubstringMatch
Method of the class: AttributeMatchingExtension{}
No Hooks.
Returns
null. Nothing (null).
Usage
$AttributeMatchingExtension = new AttributeMatchingExtension(); $AttributeMatchingExtension->translateSubstringMatch( $xpath, $attribute, ?string $value ): XPathExpr;
- $xpath(XPathExpr) (required)
- .
- $attribute(string) (required)
- .
- ?string $value(required)
- .
AttributeMatchingExtension::translateSubstringMatch() AttributeMatchingExtension::translateSubstringMatch code WC 10.8.1
public function translateSubstringMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr
{
return $xpath->addCondition($value ? sprintf(
'%1$s and contains(%1$s, %2$s)',
$attribute,
Translator::getXpathLiteral($value)
) : '0');
}