Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor

AbstractHtmlProcessor::ensureExistenceOfBodyElementprivateWC 1.0

Checks that $this->domDocument has a BODY element and adds it if it is missing.

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

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->ensureExistenceOfBodyElement(): void;

Код AbstractHtmlProcessor::ensureExistenceOfBodyElement() WC 10.4.3

private function ensureExistenceOfBodyElement(): void
{
    if ($this->getDomDocument()->getElementsByTagName('body')->item(0) instanceof \DOMElement) {
        return;
    }

    $this->getHtmlElement()->appendChild($this->getDomDocument()->createElement('body'));
}