WPCF7_ConfigValidator::restore
Restore errors from the database.
Метод класса: WPCF7_ConfigValidator{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WPCF7_ConfigValidator = new WPCF7_ConfigValidator(); $WPCF7_ConfigValidator->restore();
Код WPCF7_ConfigValidator::restore() WPCF7 ConfigValidator::restore CF7 6.1.7
public function restore() {
$config_errors = get_post_meta(
$this->contact_form->id(), '_config_validation', true
);
foreach ( (array) $config_errors as $section => $errors ) {
if ( empty( $errors ) ) {
continue;
}
foreach ( (array) $errors as $error ) {
if ( ! empty( $error['code'] ) ) {
$code = $error['code'];
$args = isset( $error['args'] ) ? $error['args'] : '';
$this->add_error( $section, $code, $args );
}
}
}
}