WordPress at a glance
function is not described

js_escape() WP 2.0.4

Deprecated in 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().

  • See: esc_js()

No Hooks.


String. Escaped text.


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

Code of js escape: wp-includes/deprecated.php WP 5.2.2

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