W3cubDocs

/WordPress

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

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

Legacy escaping for HTML blocks.

Description

See also

Parameters

$string

(string) (Required) String to escape.

$quote_style

(string) (Optional) Unused.

Default value: ENT_NOQUOTES

$charset

(false|string) (Optional) Unused.

Default value: false

$double_encode

(false) (Optional) Whether to double encode. Unused.

Default value: false

Return

(string) Escaped $string.

Source

File: wp-includes/deprecated.php

function wp_specialchars( $string, $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.
		$args = func_get_args();
		return call_user_func_array( '_wp_specialchars', $args );
	} else {
		return esc_html( $string );
	}
}

Changelog

Version Description
2.8.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_specialchars