wp_specialchars()
Deprecated since 2.8.0. It is no longer supported and may be removed in future releases. Use esc_html() instead.
Legacy escaping for HTML blocks.
No Hooks.
Returns
String. Escaped $text.
Usage
wp_specialchars( $text, $quote_style, $charset, $double_encode );
- $text(string) (required)
- Text to escape.
- $quote_style(string)
- Unused.
Default: ENT_NOQUOTES - $charset(false|string)
- Unused.
Default: false - $double_encode(false)
- Whether to double encode. Unused.
Default: false
Notes
- See: esc_html()
Changelog
| Deprecated since 2.8.0 | Use esc_html() |
wp_specialchars() wp specialchars code WP 6.9
function wp_specialchars( $text, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
_deprecated_function( __FUNCTION__, '2.8.0', 'esc_html()' );
if ( func_num_args() > 1 ) { // Maintain back-compat for people passing additional arguments.
return _wp_specialchars( $text, $quote_style, $charset, $double_encode );
} else {
return esc_html( $text );
}
}