A WordPress-centric search engine for devs and theme authors



add_magic_quotes ›

Since0.71
Deprecatedn/a
add_magic_quotes ( $array )
Parameters:
  • (array) $array Array to walk while sanitizing contents.
    Required: Yes
Returns:
  • (array) Sanitized $array.
Defined at:
Codex:

Walks the array while sanitizing the contents.



Source

function add_magic_quotes( $array ) {
	foreach ( (array) $array as $k => $v ) {
		if ( is_array( $v ) ) {
			$array[ $k ] = add_magic_quotes( $v );
		} else {
			$array[ $k ] = addslashes( $v );
		}
	}
	return $array;
}