WordPress at Your Fingertips
function is not described

deslash() WP 1.5.0

Filters for content to remove unnecessary slashes.

No Hooks.

Return

String. The de-slashed content.

Usage

deslash( $content );
$content(string) (required)
The content to modify.

Changelog

Since 1.5.0 Introduced.

Code of deslash() WP 5.8.2

function deslash( $content ) {
	// Note: \\\ inside a regex denotes a single backslash.

	/*
	 * Replace one or more backslashes followed by a single quote with
	 * a single quote.
	 */
	$content = preg_replace( "/\\\+'/", "'", $content );

	/*
	 * Replace one or more backslashes followed by a double quote with
	 * a double quote.
	 */
	$content = preg_replace( '/\\\+"/', '"', $content );

	// Replace one or more backslashes with one backslash.
	$content = preg_replace( '/\\\+/', '\\', $content );

	return $content;
}