Automattic\WooCommerce\Vendor\Pelago\Emogrifier
CssInliner::addStyleElementToDocument
Adds a style element with $css to $this->domDocument.
This method is protected to allow overriding.
Метод класса: CssInliner{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->addStyleElementToDocument( $css ): void;
- $css(строка) (обязательный)
- .
Заметки
Код CssInliner::addStyleElementToDocument() CssInliner::addStyleElementToDocument WC 10.4.3
protected function addStyleElementToDocument(string $css): void
{
$domDocument = $this->getDomDocument();
$styleElement = $domDocument->createElement('style', $css);
$styleAttribute = $domDocument->createAttribute('type');
$styleAttribute->value = 'text/css';
$styleElement->appendChild($styleAttribute);
$headElement = $this->getHeadElement();
$headElement->appendChild($styleElement);
}