Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFormProcessor::add_validation_notices │ private │ WC 1.0

Add form validation notices.

Method of the class: OrderWithdrawalFormProcessor{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->add_validation_notices( $errors ): void;
$errors(array<string,string>) (required)
Validation errors keyed by field.

OrderWithdrawalFormProcessor::add_validation_notices() code WC 11.1.2

private function add_validation_notices( array $errors ): void {
	foreach ( $errors as $field_key => $message ) {
		wc_add_notice( $message, 'error', array( 'id' => self::get_field_name( $field_key ) ) );
	}
}