Automattic\WooCommerce\Internal\EmailEditor

WooContentProcessor::get_html_body_contentprivateWC 1.0

Get the content of the body tag from the HTML.

Method of the class: WooContentProcessor{}

No Hooks.

Returns

String.

Usage

// private - for code of main (parent) class only
$result = $this->get_html_body_content( $html ): string;
$html(string) (required)
HTML.

WooContentProcessor::get_html_body_content() code WC 10.3.6

private function get_html_body_content( string $html ): string {
	// Extract content between <body> and </body> tags using regex.
	if ( preg_match( '/<body[^>]*>(.*?)<\/body>/is', $html, $matches ) ) {
		return $matches[1];
	}
	return $html;
}