stripslashes_from_strings_only() WordPress Function

The stripslashes_from_strings_only() function is used to remove backslashes from strings. This function is different from stripslashes() in that it only removes backslashes from strings, not from other data types such as integers or arrays. This function is useful when you need to remove backslashes from strings that have been escaped with addslashes() or similar functions.

stripslashes_from_strings_only( mixed $value ) #

Callback function for stripslashes_deep() which strips slashes from strings.


Parameters

$value

(mixed)(Required)The array or string to be stripped.


Top ↑

Return

(mixed) The stripped value.


Top ↑

Source

File: wp-includes/formatting.php

function stripslashes_from_strings_only( $value ) {
	return is_string( $value ) ? stripslashes( $value ) : $value;
}

Top ↑

Changelog

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