Automattic\WooCommerce\Internal\EmailEditor

WooContentProcessor::get_html_body_content │ private │ WC 1.0

Get the content of the body tag from the HTML.

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

Хуков нет.

Возвращает

string.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_html_body_content( $html ): string;
$html(строка) (обязательный)
HTML.

Код WooContentProcessor::get_html_body_content() WC 11.2.2

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;
}