WPCF7_HTMLFormatter::normalize_paragraph()public staticCF7 1.0

Normalizes a paragraph of text.

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

Хуков нет.

Возвращает

Строку. The normalized paragraph.

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

$result = WPCF7_HTMLFormatter::normalize_paragraph( $paragraph, $auto_br );
$paragraph(строка) (обязательный)
A paragraph of text.
$auto_br(true|false)
If true, line breaks will be replaced by a br element.
По умолчанию: false

Код WPCF7_HTMLFormatter::normalize_paragraph() CF7 6.0.1

public static function normalize_paragraph( $paragraph, $auto_br = false ) {
	if ( $auto_br ) {
		$paragraph = preg_replace( '/\s*\n\s*/', "<br />\n", $paragraph );
	}

	$paragraph = preg_replace( '/[ ]+/', " ", $paragraph );

	return $paragraph;
}