Uses
Uses | Description |
---|---|
wp-includes/formatting.php: map_deep() | Maps a function to all non-iterable elements of an array or an object. |
Navigates through an array, object, or scalar, and removes slashes from the values.
(mixed) (Required) The value to be stripped.
(mixed) Stripped value.
If an array is passed, the array_map() function causes a callback to pass the value back to the function. The slashes from each value will be removed using the stripslashes() function.
WordPress ignores the built-in PHP magic quotes setting and the value of get_magic_quotes_gpc() and will always add magic quotes (even after the feature is removed from PHP in 5.4).
WordPress does this because too much core and plugin code have come to rely on the quotes being there, so disabling quotes on the superglobals (as is done in both the “Basic Example” and “Good Coding Practice” examples above) is likely to cause security holes.
File: wp-includes/formatting.php
function stripslashes_deep( $value ) { return map_deep( $value, 'stripslashes_from_strings_only' ); }
Version | Description |
---|---|
2.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/stripslashes_deep