sanitize_text_field
函数
sanitize_text_field ( $str )
- 参数
-
-
(string)
$str
String to sanitize.- Required: 是
-
(string)
- 返回值
-
- (string) Sanitized string.
- 相关
-
- sanitize_textarea_field()
- wp_check_invalid_utf8()
- wp_strip_all_tags()
- 定义位置
-
-
wp-includes/formatting.php
, line 5423
-
wp-includes/formatting.php
- 引入
- 2.9.0
- 弃用
- –
Sanitizes a string from user input or from the database.
– Checks for invalid UTF-8,
– Converts single `
– Strips all tags
– Removes line breaks, tabs, and extra whitespace
– Strips octets
function sanitize_text_field( $str ) { $filtered = _sanitize_text_fields( $str, false ); /** * Filters a sanitized text field string. * * @since 2.9.0 * * @param string $filtered The sanitized string. * @param string $str The string prior to being sanitized. */ return apply_filters( 'sanitize_text_field', $filtered, $str ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。