Yoast\WP\SEO\Helpers
String_Helper::standardize_whitespace()
Standardize whitespace in a string.
Replace line breaks, carriage returns, tabs with a space, then remove double spaces.
Метод класса: String_Helper{}
Хуков нет.
Возвращает
Строку
.
Использование
$String_Helper = new String_Helper(); $String_Helper->standardize_whitespace( $text );
- $text(строка) (обязательный)
- Text input to standardize.
Код String_Helper::standardize_whitespace() String Helper::standardize whitespace Yoast 22.4
public function standardize_whitespace( $text ) { return \trim( \str_replace( ' ', ' ', \str_replace( [ "\t", "\n", "\r", "\f" ], ' ', $text ) ) ); }