WordPress开发者和主题制作者的搜索引擎



wp_specialchars ›

Sincen/a
已弃用2.8.0
wp_specialchars ( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false )
参数: (4)
  • (string) $string String to escape.
    Required: Yes
  • (string) $quote_style Unused.
    Required: No
    默认: ENT_NOQUOTES
  • (false|string) $charset Unused.
    Required: No
    默认: false
  • (false) $double_encode Whether to double encode. Unused.
    Required: No
    默认: false
查看:
返回:
  • (string) Escaped `$string`.
定义在:
文档:

Legacy escaping for HTML blocks.



源码

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.
		return _wp_specialchars( $string, $quote_style, $charset, $double_encode );
	} else {
		return esc_html( $string );
	}
}