esc_textarea()
esc_textarea( string $text ) 文本区域值的转义。Escaping for text…
esc_textarea( string $text )
文本区域值的转义。
Escaping for textarea values.
目录锚点:#参数#返回#源码#笔记
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| $text | (string) | 必需 |
返回(Return)
(string)
源码(Source)
/**
* Escaping for textarea values.
*
* @since 3.1.0
*
* @param string $text
* @return string
*/
function esc_textarea( $text ) {
$safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) );
/**
* Filter a string cleaned and escaped for output in a textarea element.
*
* @since 3.1.0
*
* @param string $safe_text The text after it has been escaped.
* @param string $text The text prior to being escaped.
*/
return apply_filters( 'esc_textarea', $safe_text, $text );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 3.1.0 | wp-includes/formatting.php:4506 | 9 | 3 |
笔记(Notes)
此函数的适用范围似乎比其名称所示的更广,请参见https://developer.wordpress.org/reference/functions/esc_attr/#注释-2473个
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

还没有任何评论,赶紧来占个楼吧!