WPCF7_ConfigValidator::remove_error()publicCF7 1.0

Removes an error.

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

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WPCF7_ConfigValidator = new WPCF7_ConfigValidator();
$WPCF7_ConfigValidator->remove_error( $section, $code );
$section(строка) (обязательный)
The section where the error detected.
$code(строка) (обязательный)
The unique code of the error.

Код WPCF7_ConfigValidator::remove_error() CF7 5.9.3

public function remove_error( $section, $code ) {
	if ( empty( $this->errors[$section] ) ) {
		return;
	}

	foreach ( (array) $this->errors[$section] as $key => $error ) {
		if ( isset( $error['code'] ) and $error['code'] === $code ) {
			unset( $this->errors[$section][$key] );
		}
	}

	if ( empty( $this->errors[$section] ) ) {
		unset( $this->errors[$section] );
	}
}