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.
Contents
Parameters
- $value
(mixed)(Required)The array or string to be stripped.
Return
(mixed) The stripped value.
Source
File: wp-includes/formatting.php
function stripslashes_from_strings_only( $value ) { return is_string( $value ) ? stripslashes( $value ) : $value; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |