WPCF7_ConfigValidator::restore()publicCF7 1.0

Restore errors from the database.

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

Хуков нет.

Возвращает

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

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

$WPCF7_ConfigValidator = new WPCF7_ConfigValidator();
$WPCF7_ConfigValidator->restore();

Код WPCF7_ConfigValidator::restore() CF7 5.9.3

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