sanitize_textarea_field() WP 1.0
Sanitizes a multiline string from user input or from the database.
The function is like sanitize_text_field(), but preserves new lines (\n) and other whitespace, which are legitimate input in textarea elements.
Works based on: _sanitize_text_fields()
1 time = 0.000098s = very fast | 50000 times = 1.17s = fast | PHP 7.1.2, WP 4.7.3
Hooks from the function
Return
String. Sanitized string.
Usage
sanitize_textarea_field( $str );
- $str(string) (required)
- String to sanitize.
Notes
- See: sanitize_text_field()
Changelog
Since 4.7.0 | Introduced. |
Code of sanitize_textarea_field() sanitize textarea field WP 5.6
function sanitize_textarea_field( $str ) {
$filtered = _sanitize_text_fields( $str, true );
/**
* Filters a sanitized textarea field string.
*
* @since 4.7.0
*
* @param string $filtered The sanitized string.
* @param string $str The string prior to being sanitized.
*/
return apply_filters( 'sanitize_textarea_field', $filtered, $str );
}Related Functions
From tag: sanitize_
- sanitize_email()
- sanitize_file_name()
- sanitize_html_class()
- sanitize_meta()
- sanitize_option()
- sanitize_post()