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

AttributeMatchingExtension::translateDifferentpublicWC 1.0

Method of the class: AttributeMatchingExtension{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

AttributeMatchingExtension::translateDifferent() code WC 10.7.0

public function translateDifferent(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr
{
    return $xpath->addCondition(sprintf(
        $value ? 'not(%1$s) or %1$s != %2$s' : '%s != %s',
        $attribute,
        Translator::getXpathLiteral($value)
    ));
}