_wp_specialchars
- %1$s is private and should not be used in themes or plugins directly.
_wp_specialchars ( $text, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false )
Access:Parameters:- (string) text 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. Converts single and double quotes, as well as converting HTML named entities (that are not also XML named entities) to their code points if set to ENT_XML1. 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 false.
- (bool) double_encode Optional. Whether to encode existing HTML entities. Default false.
Returns:- (string) The encoded text with HTML entities.
Defined at:Change Log: - Introduced in WordPress: 1.2.2
- Deprecated in WordPress: —
Description
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.