Automattic\WooCommerce\EmailEditorVendor\Pelago\Emogrifier\HtmlProcessor

CssVariableEvaluator::getPropertyValueReplacement │ private │ WC 1.0

Callback function for {@see replaceVariablesInPropertyValue} performing regular expression replacement.

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

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->getPropertyValueReplacement( $matches ): string;
$matches(array<int, string>) (обязательный)
.

Код CssVariableEvaluator::getPropertyValueReplacement() WC 11.3.0

private function getPropertyValueReplacement(array $matches): string
{
    $variableName = $matches[1];

    if (isset($this->currentVariableDefinitions[$variableName])) {
        $variableValue = $this->currentVariableDefinitions[$variableName];
    } else {
        $fallbackValueSeparator = $matches[2] ?? '';
        if ($fallbackValueSeparator !== '') {
            $fallbackValue = $matches[3];
            // The fallback value may use other CSS variables, so recurse
            $variableValue = $this->replaceVariablesInPropertyValue($fallbackValue);
        } else {
            $variableValue = $matches[0];
        }
    }

    return $variableValue;
}