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

AttributeMatchingExtension::translateSuffixMatch │ public │ WC 1.0

Метод класса: AttributeMatchingExtension{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$AttributeMatchingExtension = new AttributeMatchingExtension();
$AttributeMatchingExtension->translateSuffixMatch( $xpath, $attribute, ?string $value ): XPathExpr;
$xpath(XPathExpr) (обязательный)
.
$attribute(строка) (обязательный)
.
?string $value(обязательный)
.

Код AttributeMatchingExtension::translateSuffixMatch() WC 11.2.2

public function translateSuffixMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr
{
    return $xpath->addCondition($value ? sprintf(
        '%1$s and substring(%1$s, string-length(%1$s)-%2$s) = %3$s',
        $attribute,
        \strlen($value) - 1,
        Translator::getXpathLiteral($value)
    ) : '0');
}