WP_Error::remove() WordPress Method
The WP_Error::remove() method is used to remove an error from a WP_Error object. This is useful if you want to get rid of an error that has been added to the object, but don't want to destroy the entire object.
WP_Error::remove( string|int $code ) #
Removes the specified error.
Description
This function removes all error messages associated with the specified error code, along with any error data for that code.
Parameters
- $code
(string|int)(Required)Error code.
Source
File: wp-includes/class-wp-error.php
public function remove( $code ) { unset( $this->errors[ $code ] ); unset( $this->error_data[ $code ] ); unset( $this->additional_data[ $code ] ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.1.0 | Introduced. |