WordPress 4.1.1-scripts
[autoinstalls/wordpress.git] / wp-includes / class-wp-error.php
index 971a4c7a955e64db961c758ca61f1a89957aad3c..cee2affb991696a2bd925b5238fe6fe0dc36c70f 100644 (file)
@@ -242,6 +242,21 @@ class WP_Error {
 
                $this->error_data[$code] = $data;
        }
+
+       /**
+        * Removes the specified error.
+        *
+        * This function removes all error messages associated with the specified
+        * error code, along with any error data for that code.
+        *
+        * @since 4.1.0
+        *
+        * @param string|int $code Error code.
+        */
+       public function remove( $code ) {
+               unset( $this->errors[ $code ] );
+               unset( $this->error_data[ $code ] );
+       }
 }
 
 /**