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