js_escape()
js_escape( string $text )
转义单引号、特殊双引号和固定行尾。
Escape single quotes, specialchar double quotes, and fix line endings.
说明(Description)
另见函数 esc_js()
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$text | (string) | 必需 | 要转义的文本。 |
返回(Return)
(string)转义文本。
源码(Source)
js_escape() 函数的代码位于 wp-includes/formatting.php.
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
2.8.0 | wp-includes/deprecated.php:2054 | 0 | 2 |
js_escape() 为WP2原创文章,链接:https://www.wp2.cn/functions/js_escape/