A WordPress-centric search engine for devs and theme authors



wp_specialchars ›

Sincen/a
Deprecated2.8.0
wp_specialchars ( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false )
Parameters: (4)
  • (string) $string String to escape.
    Required: Yes
  • (string) $quote_style Unused.
    Required: No
    Default: ENT_NOQUOTES
  • (false|string) $charset Unused.
    Required: No
    Default: false
  • (false) $double_encode Whether to double encode. Unused.
    Required: No
    Default: false
See:
Returns:
  • (string) Escaped `$string`.
Defined at:
Codex:

Legacy escaping for HTML blocks.



Source

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