Non_Input_Element_Type_Trait::validate_field( mixed $value, awsmug\Torro_Forms\DB_Objects\Elements\Element $element, awsmug\Torro_Forms\DB_Objects\Submissions\Submission $submission )

Validates a field value for an element.

Description

Parameters

$value

(mixed) (Required) The value to validate. It is already unslashed when it arrives here.

$element

(awsmug\Torro_Forms\DB_Objects\Elements\Element) (Required) Element to validate the field value for.

$submission

(awsmug\Torro_Forms\DB_Objects\Submissions\Submission) (Required) Submission the value belongs to.

Return

(mixed|WP_Error) Validated value, or error object on failure.

Source

File: src/db-objects/elements/element-types/non-input-element-type-trait.php

	public function validate_field( $value, $element, $submission ) {
		return $this->create_error( 'value_not_accepted', __( 'No values are accepted here.', 'torro-forms' ) );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.