Codex

Function Reference/js escape

Contents

Description

Escape single quotes. Convert double quotes. Fix line endings.

The filter 'js_escape' is also applied here.

Usage

<?php js_escape$text ?>

Parameters

$text
(string) (required) The text to be escaped.
Default: None

Return Values

(string) 
Escaped text.

Examples

Notes

Change Log

Since: 2.0.4

Source File

js_escape() is located in wp-includes/formatting.php.

Related