js_escape()WP 2.0.4

Deprecated from version 2.8.0. It is no longer supported and can be removed in future releases. Use esc_js() instead.

Escape single quotes, specialchar double quotes, and fix line endings.

The filter js_escape is also applied by esc_js().

No Hooks.

Return

String. Escaped text.

Usage

js_escape( $text );
$text(string) (required)
The text to be escaped.

Notes

Changelog

Since 2.0.4 Introduced.
Deprecated since 2.8.0 Use esc_js()

js_escape() code WP 6.5.2

function js_escape( $text ) {
	_deprecated_function( __FUNCTION__, '2.8.0', 'esc_js()' );
	return esc_js( $text );
}