wpcf7_normalize_newline() CF7 1.0
Хуков нет.
Возвращает
Null. Ничего.
Использование
wpcf7_normalize_newline( $text, $to );
- $text (обязательный)
- -
- $to **
- -
По умолчанию: "\n"
Код wpcf7_normalize_newline() wpcf7 normalize newline CF7 5.4
function wpcf7_normalize_newline( $text, $to = "\n" ) {
if ( ! is_string( $text ) ) {
return $text;
}
$nls = array( "\r\n", "\r", "\n" );
if ( ! in_array( $to, $nls ) ) {
return $text;
}
return str_replace( $nls, $to, $text );
}