Textfield::get_edit_submission_fields_args( awsmug\Torro_Forms\DB_Objects\Elements\Element $element )

Gets the fields arguments for an element of this type when editing submission values in the admin.

Description

See also

Parameters

$element

(awsmug\Torro_Forms\DB_Objects\Elements\Element) (Required) Element to get fields arguments for.

Return

(array) An associative array of <code>$field_slug => $field_args</code> pairs.

Source

File: src/db-objects/elements/element-types/base/textfield.php

	public function get_edit_submission_fields_args( $element ) {
		$fields = parent::get_edit_submission_fields_args( $element );

		$slug     = $this->get_edit_submission_field_slug( $element->id );
		$settings = $this->get_settings( $element );

		$input_type = ! empty( $settings['input_type'] ) ? $settings['input_type'] : 'text';
		$input_type = $this->get_input_type( $input_type );
		if ( $input_type && isset( $input_type['html_field_type'] ) ) {
			switch ( $input_type['html_field_type'] ) {
				case 'datetime':
				case 'date':
				case 'time':
					$fields[ $slug ]['type']  = 'datetime';
					$fields[ $slug ]['store'] = $input_type['html_field_type'];
					break;
				default:
					$fields[ $slug ]['type'] = $input_type['html_field_type'];
			}
		} else {
			$fields[ $slug ]['type'] = 'text';
		}

		return $fields;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.