Index: wp-includes/formatting.php
===================================================================
--- wp-includes/formatting.php	(revision 20636)
+++ wp-includes/formatting.php	(working copy)
@@ -1311,6 +1311,32 @@
 }
 
 /**
+ * Navigates through an array and adds slashes to the values.
+ *
+ * If an array is passed, the array_map() function causes a callback to pass the
+ * value back to the function. Slashes will be added to this value.
+ *
+ * @since 3.4.0
+ *
+ * @param array|string $value The array or string to be slashed.
+ * @return array|string Slashed array (or string in the callback).
+ */
+function addslashes_deep($value) {
+	if ( is_array($value) ) {
+		$value = array_map('addslashes_deep', $value);
+	} elseif ( is_object($value) ) {
+		$vars = get_object_vars( $value );
+		foreach ($vars as $key=>$data) {
+			$value->{$key} = addslashes_deep( $data );
+		}
+	} else {
+		$value = addslashes($value);
+	}
+
+	return $value;
+}
+
+/**
  * Navigates through an array and removes slashes from the values.
  *
  * If an array is passed, the array_map() function causes a callback to pass the
