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

AttributeMatchingExtension::translateDashMatch │ public │ WC 1.0

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

Хуков нет.

Возвращает

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

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

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

Код AttributeMatchingExtension::translateDashMatch() WC 11.2.2

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.'-')
    ));
}