【WordPress相关】WordPress 常用函数 / esc_html
作品分类:Wordpress相关 实体 编码 文本 函数 常用 WordPress esc_html
WordPress 常用函数 / esc_html,
简介
将 < > & ” ‘(小于号,大于号,&,双引号,单引号)编码,转成HTML 实体,已经是实体的并不转换。
功能和类似。
用法
<?php esc_html( $text ) ?>
参数
$text
(string) (required) 将编码成实体的文本。
Default: 无
<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
返回值
(string)
已经编码成 HTML 实体的文本。
修改记录
Since: 2.8.0
源文件
wp-includes/formatting.php
原创文章,作者:starterknow,如若转载,请注明出处:https://www.starterknow.com/31963.html