函数原型
deslash( string $content ): string
函数描述
Filters for content to remove unnecessary slashes.
是否弃用
未弃用
函数参数
-
$content
string
Required - The content to modify.
函数返回值
string The de-slashed content.
函数位置
File: wp-admin/includes/upgrade.php.
函数源码
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;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |

