sanitize_text_field
sanitize_text_field ( $str )
Parameters:- (string) str String to sanitize.
See:Returns:- (string) Sanitized string.
Defined at: - Introduced in WordPress: 2.9.0
- Deprecated in WordPress: —
Description
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 percent-encoded characters