wp_kses_stripslashes() WordPress Function

The wp_kses_stripslashes() function is used to remove slashes from a string. This function is typically used to remove slashes added by the addslashes() function.

wp_kses_stripslashes( string $string ) #

Strips slashes from in front of quotes.


Description

This function changes the character sequence \" to just ". It leaves all other slashes alone. The quoting from preg_replace(//e) requires this.


Top ↑

Parameters

$string

(string)(Required)String to strip slashes from.


Top ↑

Return

(string) Fixed string with quoted slashes.


Top ↑

Source

File: wp-includes/kses.php

function wp_kses_stripslashes( $string ) {
	return preg_replace( '%\\\\"%', '"', $string );
}

Top ↑

Changelog

Changelog
VersionDescription
1.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.