This function has been deprecated. Use esc_js() instead.

js_escape( string $text )

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


Description

The filter ‘js_escape’ is also applied by esc_js().

See also


Parameters

$text

(string) (Required) The text to be escaped.


Return

(string) Escaped text.


Source

File: wp-includes/deprecated.php

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


Changelog

Changelog
Version Description
WP-2.8.0 Use esc_js()
WP-2.0.4 Introduced. This function has been deprecated. Use esc_js() instead.