sanitize_text_field ( $str )
- (string) $str String to sanitize.
- (string) Sanitized string.
- Introduced in WordPress: 2.9.0
- Deprecated in WordPress: —
Sanitizes a string from user input or from the database.
- Checks for invalid UTF-8,
- Converts single
< characters to entities
- Strips all tags
- Removes line breaks, tabs, and extra whitespace
- Strips octets