函数原型
js_escape( string $text ): string
函数描述
Escape single quotes, specialchar double quotes, and fix line endings.
是否弃用
Warning: This function has been deprecated. Use esc_js() instead.
函数参数
-
$text
string
Required - The text to be escaped.
函数返回值
string Escaped text.
函数位置
File: wp-includes/deprecated.php.
函数源码
function js_escape( $text ) {
_deprecated_function( __FUNCTION__, '2.8.0', 'esc_js()' );
return esc_js( $text );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.8.0 | Use esc_js() |
| 2.0.4 | Introduced. |

