wc_esc_json()
Escape JSON for use on HTML or attribute text nodes.
wc_esc_json(string $json[, bool $html = false ]) : string
Parameters
- $json : string
-
JSON to escape.
- $html : bool = false
-
True if escaping for HTML text node, false for attributes. Determines how quotes are handled.
Tags
Return values
string —Escaped JSON.