Uses
| Uses | Description |
|---|---|
| wp-includes/functions.php: add_magic_quotes() | Walks the array while sanitizing the contents. |
Walks the array while sanitizing the contents.
(array) (Required) Array to walk while sanitizing contents.
(array) Sanitized $array.
File: wp-includes/functions.php
function add_magic_quotes( $array ) {
foreach ( (array) $array as $k => $v ) {
if ( is_array( $v ) ) {
$array[ $k ] = add_magic_quotes( $v );
} elseif ( is_string( $v ) ) {
$array[ $k ] = addslashes( $v );
} else {
continue;
}
}
return $array;
} | Version | Description |
|---|---|
| 5.5.0 | Non-string values are left untouched. |
| 0.71 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/add_magic_quotes