WPCF7_Mail::htmlize()privateCF7 1.0

Creates HTML message body by adding the header and footer.

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

Возвращает

Строку. Formatted HTML.

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

// private - только в коде основоного (родительского) класса
$result = $this->htmlize( $body );
$body(строка) (обязательный)
The body part of HTML.

Код WPCF7_Mail::htmlize() CF7 5.9.3

private function htmlize( $body ) {
	if ( $this->locale ) {
		$lang_atts = sprintf( ' %s',
			wpcf7_format_atts( array(
				'dir' => wpcf7_is_rtl( $this->locale ) ? 'rtl' : 'ltr',
				'lang' => str_replace( '_', '-', $this->locale ),
			) )
		);
	} else {
		$lang_atts = '';
	}

	$header = apply_filters( 'wpcf7_mail_html_header',
		'<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml"' . $lang_atts . '>
<head>
<title>' . esc_html( $this->get( 'subject', true ) ) . '</title>
</head>
<body>
',
		$this
	);

	$body = apply_filters( 'wpcf7_mail_html_body', $body, $this );

	$footer = apply_filters( 'wpcf7_mail_html_footer',
		'</body>
</html>',
		$this
	);

	return $header . $body . $footer;
}