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

js_escape( string $text )

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


Description Description

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

See also See also


Top ↑

Parameters Parameters

$text

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


Top ↑

Return Return

(string) Escaped text.


Top ↑

Source Source

File: wp-includes/deprecated.php

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

Top ↑

Changelog Changelog

Changelog
Version Description
2.8.0 Use esc_js()
2.0.4 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.