wp_unslash() WordPress Function

The wp_unslash() function is a handy little function that helps to clean up data that has been entered into a WordPress form. This function strips slashes from a string of text, which can be useful when dealing with data that has been entered into a WordPress form. The wp_unslash() function can be used to clean up data before it is inserted into the database, or it can be used to clean up data that has been retrieved from the database.

wp_unslash( string|array $value ) #

Removes slashes from a string or recursively removes slashes from strings within an array.


Description

This should be used to remove slashes from data passed to core API that expects data to be unslashed.


Top ↑

Parameters

$value

(string|array)(Required)String or array of data to unslash.


Top ↑

Return

(string|array) Unslashed $value.


Top ↑

Source

File: wp-includes/formatting.php

function wp_unslash( $value ) {
	return stripslashes_deep( $value );
}


Top ↑

Changelog

Changelog
VersionDescription
3.6.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.

Show More