wpcf7_normalize_newline()
Normalizes newline characters.
Хуков нет.
Возвращает
Строку
. Normalized text.
Использование
wpcf7_normalize_newline( $text, $to );
- $text(строка) (обязательный)
- Input text.
- $to(строка)
- The newline character that is used in the output.
По умолчанию: "\n"
Код wpcf7_normalize_newline() wpcf7 normalize newline CF7 6.0.5
function wpcf7_normalize_newline( $text, $to = "\n" ) { if ( ! is_string( $text ) ) { return $text; } $nls = array( "\r\n", "\r", "\n" ); if ( ! in_array( $to, $nls, true ) ) { return $text; } return str_replace( $nls, $to, $text ); }