Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor
CssToAttributeConverter::mapMarginProperty
Метод класса: CssToAttributeConverter{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->mapMarginProperty( $node, $value ): void;
- $node(DOMElement) (обязательный)
- node to apply styles to.
- $value(строка) (обязательный)
- the value of the style rule to map.
Код CssToAttributeConverter::mapMarginProperty() CssToAttributeConverter::mapMarginProperty WC 11.0.1
private function mapMarginProperty(\DOMElement $node, string $value): void
{
if (!$this->isTableOrImageNode($node)) {
return;
}
$margins = $this->parseCssShorthandValue($value);
if ($margins['left'] === 'auto' && $margins['right'] === 'auto') {
$node->setAttribute('align', 'center');
}
}