-/**
- * Check whether variable is a WordPress Error.
- *
- * Looks at the object and if a WP_Error class. Does not check to see if the
- * parent is also WP_Error, so can't inherit WP_Error and still use this
- * function.
- *
- * @since 2.1.0
- *
- * @param mixed $thing Check if unknown variable is WordPress Error object.
- * @return bool True, if WP_Error. False, if not WP_Error.
- */
-function is_wp_error($thing) {
- if ( is_object($thing) && is_a($thing, 'WP_Error') )
- return true;
- return false;
+ /**
+ * 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 ] );
+ }