wp_specialchars

函数


wp_specialchars ( $text, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false )
参数
  • (string)
    $text
    Text to escape.
    Required:
  • (string)
    $quote_style
    Unused.
    Required:
    Default: ENT_NOQUOTES
  • (false|string)
    $charset
    Unused.
    Required:
    Default: false
  • (false)
    $double_encode
    Whether to double encode. Unused.
    Required:
    Default: false
返回值
  • (string) Escaped `$text`.
相关
  • esc_html()
定义位置
  • wp-includes/deprecated.php
    , line 2079
引入
弃用
2.8.0

Legacy escaping for HTML blocks.

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