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

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

Legacy escaping for HTML blocks.

Description

See also

Parameters

$textstringrequired
Text to escape.
$quote_stylestringoptional
Unused.

Default:ENT_NOQUOTES

$charsetfalse|stringoptional
Unused.

Default:false

$double_encodefalseoptional
Whether to double encode. Unused.

Default:false

Return

string Escaped $text.

Source

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

Changelog

VersionDescription
2.8.0Introduced.

User Contributed Notes

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