Textfield::get_input_types()

Returns the available input types for a text element field.

Description

See also

Return

(array) Associative array of <code>$slug => $data</code> pairs.

Source

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

	protected function get_input_types() {
		$input_types = array(
			'text'           => array(
				'title'           => __( 'Standard Text', 'torro-forms' ),
				'html_field_type' => 'text',
			),
			'password'       => array(
				'title'           => __( 'Password', 'torro-forms' ),
				'html_field_type' => 'password',
			),
			'date'           => array(
				'title'           => __( 'Date', 'torro-forms' ),
				'html_field_type' => 'date',
			),
			'email_address'  => array(
				'title'           => __( 'Email-Address *', 'torro-forms' ),
				'html_field_type' => 'email',
				'callback'        => 'is_email',
				'error_message'   => __( 'The value you entered is not a valid email-address.', 'torro-forms' ),
			),
			'color'          => array(
				'title'           => __( 'Color', 'torro-forms' ),
				'html_field_type' => 'color',
			),
			'number'         => array(
				'title'           => __( 'Number *', 'torro-forms' ),
				'html_field_type' => 'number',
				'pattern'         => '^[0-9]{1,}$',
				'error_message'   => __( 'The value you entered is not a valid number.', 'torro-forms' ),
			),
			'number_decimal' => array(
				'title'           => __( 'Decimal Number *', 'torro-forms' ),
				'html_field_type' => 'number',
				'pattern'         => '^-?([0-9])+\.?([0-9])+$',
				'error_message'   => __( 'The value you entered is not a valid decimal number.', 'torro-forms' ),
			),
			'search'         => array(
				'title'           => __( 'Search', 'torro-forms' ),
				'html_field_type' => 'search',
			),
			'tel'            => array(
				'title'           => __( 'Telephone', 'torro-forms' ),
				'html_field_type' => 'tel',
			),
			'time'           => array(
				'title'           => __( 'Time', 'torro-forms' ),
				'html_field_type' => 'time',
			),
			'url'            => array(
				'title'           => __( 'URL *', 'torro-forms' ),
				'html_field_type' => 'url',
				'pattern'         => '\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]',
				'error_message'   => __( 'The value you entered is not a valid URL.', 'torro-forms' ),
			),
			'week'           => array(
				'title'           => __( 'Week', 'torro-forms' ),
				'html_field_type' => 'week',
			),
		);

		/**
		 * Filters the available input types for a text element field.
		 *
		 * @since 1.0.0
		 *
		 * @param array $input_types Associative array of `$slug => $data` pairs.
		 */
		return apply_filters( "{$this->manager->get_prefix()}element_textfield_input_types", $input_types );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.