Gf_Tokens::get_field_type( $field )


Parameters Parameters

$field

(Required)


Top ↑

Return Return

(string)


Source Source

File: src/integrations/gravity-forms/tokens/gf-tokens.php

	function get_field_type( $field ) {
		if ( is_object( $field ) && isset( $field->type ) ) {
			$field_type = $field->type;
		} elseif ( is_array( $field ) && key_exists( 'type', $field ) ) {
			$field_type = $field['type'];
		} else {
			$field_type = 'text';
		}

		switch ( $field_type ) {
			case'email':
				$type = 'email';
				break;
			case 'number':
				$type = 'int';
				break;
			default:
				$type = 'text';
		}

		return $type;
	}