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



wp_specialchars › WordPress Function

Sincen/a
已弃用2.8.0
wp_specialchars ( $text, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false )
参数: (4)
  • (string) $text Text 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 `$text`.
定义在:
文档:

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