Automattic\WooCommerce\EmailEditor\Integrations\Utils
Dom_Document_Helper::get_element_inner_html
Returns the inner HTML of the given element.
Method of the class: Dom_Document_Helper{}
No Hooks.
Returns
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() Dom Document Helper::get element inner html code WC 10.9.4
public function get_element_inner_html( \DOMElement $element ): string {
$inner_html = '';
$children = $element->childNodes; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
foreach ( $children as $child ) {
$inner_html .= $this->dom->saveHTML( $child );
}
return $inner_html;
}