js_escape
apply_filters( ‘js_escape’, string $safe_text , string $text )
过滤器::过滤一个已清理并转义的字符串,以便在JavaScript中输出。
Filter Hook: Filters a string cleaned and escaped for output in JavaScript.
说明(Description)
传递给esc_js()的文本将去掉无效或特殊字符,并为输出正确地斜杠。
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$safe_text | (string) | 转义后的文本。 |
$text | (string) | 在被转义之前的文本。 |
源码(Source)
js_escape() 函数的代码位于 wp-includes/formatting.php.
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
2.0.6 | wp-includes/formatting.php:4445 | 1 | 0 |
js_escape 为WP2原创文章,链接:https://www.wp2.cn/hook/js_escape-2/