Automattic\WooCommerce\EmailEditor\Integrations\Utils

Dom_Document_Helper::load_htmlprivateWC 1.0

Loads the given HTML content into the DOMDocument.

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

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->load_html( $html_content ): void;
$html_content(строка) (обязательный)
The HTML content to load.

Код Dom_Document_Helper::load_html() WC 9.9.5

private function load_html( string $html_content ): void {
	libxml_use_internal_errors( true );
	$this->dom = new \DOMDocument();
	if ( ! empty( $html_content ) ) {
		// prefixing the content with the XML declaration to force the input encoding to UTF-8.
		$this->dom->loadHTML( '<?xml encoding="UTF-8">' . $html_content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD );
	}
	libxml_clear_errors();
}