функция
since 1.5.0
deslash()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
deslash( string $content ): string
Описание
Фильтрует содержимое, чтобы удалить лишние слэши.
Параметры
$content
string
обязательный
Содержимое для изменения.
Возвращаемое значение
string
Исходный код
wp-admin/includes/upgrade.php:2897
function deslash( $content ) {
// Note: \\\ inside a regex denotes a single backslash.
/*
* Replace one or more backslashes followed by a single quote with
* a single quote.
*/
$content = preg_replace( "/\\\+'/", "'", $content );
/*
* Replace one or more backslashes followed by a double quote with
* a double quote.
*/
$content = preg_replace( '/\\\+"/', '"', $content );
// Replace one or more backslashes with one backslash.
$content = preg_replace( '/\\\+/', '\\', $content );
return $content;
}
История изменений
| Версия | Описание |
|---|---|
| 1.5.0 | Introduced. |

