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.

Метод класса: WP_Error{}

No Hooks.

Return

null. Nothing.

Usage

$WP_Error = new WP_Error();
$WP_Error->remove( $code );
$code(string|int) (required)
Error code.

Changelog

Since 4.1.0 Introduced.

Code of WP_Error::remove() WP 6.1.1

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