sanitize_text_field
Filters a sanitized text field string.
Usage
add_filter( 'sanitize_text_field', 'wp_kama_sanitize_text_field_filter', 10, 2 ); /** * Function for `sanitize_text_field` filter-hook. * * @param string $filtered The sanitized string. * @param string $str The string prior to being sanitized. * * @return string */ function wp_kama_sanitize_text_field_filter( $filtered, $str ){ // filter... return $filtered; }
- $filtered(string)
- The sanitized string.
- $str(string)
- The string prior to being sanitized.
Changelog
Since 2.9.0 | Introduced. |
Where the hook is called
sanitize_text_field
wp-includes/formatting.php 5566
return apply_filters( 'sanitize_text_field', $filtered, $str );