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.


Top ↑

Parameters

$code

(string|int)(Required)Error code.


Top ↑

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 ] );
	}

Top ↑

Changelog

Changelog
VersionDescription
4.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.