WPDev.one

esc_js()

esc_js( mixed $text )

Escapes single quotes, `"`, `<`, `>`, `&`, and fixes line endings.

Parameters 1 required

Name / Type Description
$text
string

The text to be escaped.

Required

Return Value

(string)
Escaped text.

Function Information

Since Version
2.8.0
Source File
wp-includes/formatting.php
Advertisement