Automattic\WooCommerce\Blocks\Domain\Services\CheckoutFieldTypes

AbstractFieldType::validate │ public │ WC 1.0

Validates a submitted value against the constraints of this field type.

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

Хуков нет.

Возвращает

\WP_Error|null. Error if the value is not valid for the field type, null otherwise.

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

$AbstractFieldType = new AbstractFieldType();
$AbstractFieldType->validate( $value, $field );
$value(разное) (обязательный)
The submitted value.
$field(массив) (обязательный)
The field.

Код AbstractFieldType::validate() WC 11.2.2

public function validate( $value, array $field ) {
	return null;
}