- %1$s is private and should not be used in themes or plugins directly.
_wp_specialchars ( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false )
- (string) $string The text which is to be encoded.
- (int|string) $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES.
- (false|string) $charset Optional. The character encoding of the string. Default is false.
- (bool) $double_encode Optional. Whether to encode existing html entities. Default is false.
- (string) The encoded text with HTML entities.
- Introduced in WordPress: 1.2.2
- Deprecated in WordPress: —
Converts a number of special characters into their HTML entities.
Specifically deals with: &, <, >, ", and '.
$quote_style can be set to ENT_COMPAT to encode " to
", or ENT_QUOTES to do both. Default is ENT_NOQUOTES where no quotes are encoded.