Warning: This function has been deprecated. Use esc_html() instead.

wp_specialchars( string $text, string $quote_style = ENT_NOQUOTES, false|string $charset = false, false $double_encode = false ): string

Legacy escaping for HTML blocks.


Description

Top ↑

See also


Top ↑

Parameters

$text string Required
Text to escape.
$quote_style string Optional
Unused.

Default: ENT_NOQUOTES

$charset false|string Optional
Unused.

Default: false

$double_encode false Optional
Whether to double encode. Unused.

Default: false


Top ↑

Return

string Escaped $text.


Top ↑

Source

File: wp-includes/deprecated.php. View all references

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 );
	}
}


Top ↑

Changelog

Changelog
Version Description
2.8.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.