X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/48ab98cb1779cf2088c1351ac3dd3d0da6fb31d3..a7cd4c052013b423c6301153f68c7fdbaa2a447b:/wp-includes/class-wp-error.php?ds=inline diff --git a/wp-includes/class-wp-error.php b/wp-includes/class-wp-error.php index 971a4c7a..cee2affb 100644 --- a/wp-includes/class-wp-error.php +++ b/wp-includes/class-wp-error.php @@ -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 ] ); + } } /**