WP_Error::remove()publicWP 4.1.0

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.

Return

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() code WP 6.5.2

public function remove( $code ) {
	unset( $this->errors[ $code ] );
	unset( $this->error_data[ $code ] );
	unset( $this->additional_data[ $code ] );
}