MailPoet\EmailEditor\Integrations\Utils

Dom_Document_Helper::get_element_inner_html()publicWC 1.0

Returns the inner HTML of the given element.

Method of the class: Dom_Document_Helper{}

No Hooks.

Return

null. Nothing (null).

Usage

$Dom_Document_Helper = new Dom_Document_Helper();
$Dom_Document_Helper->get_element_inner_html( $element ): string;
$element(\DOMElement) (required)
The element to get the inner HTML from.

Dom_Document_Helper::get_element_inner_html() code WC 9.8.1

public function get_element_inner_html( \DOMElement $element ): string {
	$inner_html = '';
	$children   = $element->childNodes; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
	foreach ( $children as $child ) {
		if ( ! $child instanceof \DOMNode ) {
			continue;
		}
		$inner_html .= $this->dom->saveHTML( $child );
	}
	return $inner_html;
}