On this page
add_magic_quotes( array $array ): array
Walks the array while sanitizing the contents.
Parameters
$arrayarray Required-
Array to walk while sanitizing contents.
Return
array Sanitized $array.
Source
File: wp-includes/functions.php. View all references
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;
}
Related
Uses
| Uses | Description |
|---|---|
| add_magic_quotes() wp-includes/functions.php | Walks the array while sanitizing the contents. |
Used By
| Used By | Description |
|---|---|
| _fix_attachment_links() wp-admin/includes/post.php | Replaces hrefs of attachment anchors with up-to-date permalinks. |
| wp_magic_quotes() wp-includes/load.php | Add magic quotes to |
| add_magic_quotes() wp-includes/functions.php | Walks the array while sanitizing the contents. |
| wp_update_user() wp-includes/user.php | Updates a user in the database. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/add_magic_quotes