WP_Error::remove
Removes the specified error.
This function removes all error messages associated with the specified error code, along with any error data for that code.
Method of the class: WP_Error{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WP_Error = new WP_Error(); $WP_Error->remove( $code );
- $code(string|int) (required)
- Error code.
Changelog
| Since 4.1.0 | Introduced. |
WP_Error::remove() WP Error::remove code WP 6.8.3
public function remove( $code ) {
unset( $this->errors[ $code ] );
unset( $this->error_data[ $code ] );
unset( $this->additional_data[ $code ] );
}