WPCF7_ConfigValidator::remove_error
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() WPCF7 ConfigValidator::remove error CF7 6.1.5
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] );
}
}