本文整理自网络,侵删。
函数esc_js()(过滤 Html 内嵌 JS)
参数
$text
(字符串)(必须)要过滤的字符串。
默认值:None
返回值
(字符串)返回过滤后的字符串。
例子
<input type="text" value="<?php echo esc_attr( $instance['input_text'] ); ?>" id="subbox" onfocus="if ( this.value == '<?php echo esc_js( $instance['input_text'] ); ?>') { this.value = ''; }" onblur="if ( this.value == '' ) { this.value = '<?php echo esc_js( $instance['input_text'] ); ?>'; }" name="email" />
更多
此函数位于:wp-includes/formatting.php
相关阅读 >>
wordpress升级版本及安装插件出现”problem with the ssl ca cert”的解决办法
wordpress 如何从后台数据库修改theme(图文教程)
不用wordpress插件显示文章浏览统计功能代码修改(原理分析)
linux xampp下启用wordpress的自定义文件名(伪静态)功能
优化wordpress分类链接及wp-no-category-base的卸载方法
更多相关阅读请进入《wordpress》频道 >>