GF_Field_Address
Source: includes/fields/class-gf-field-address.php:7
Details
- Kind:
class - Namespace:
(global) - Extends: GF_Field
Properties
| Property | Type | Description |
|---|---|---|
$repeatable | bool | Whether the field can be used in a repeater. |
$_supports_state_validation | bool | Indicates if this field supports state validation. |
$noURLs | bool | Whether this field allows links/URLs in the value. |
Methods
| Method | Description |
|---|---|
get_form_editor_field_description() | Returns the field's form editor description. |
get_form_editor_field_icon() | Returns the field's form editor icon. |
get_required_inputs_ids() | Defines the IDs of required inputs. |
get_field_container_tag() | Returns the HTML tag for the field container. |
validate() | Validates the address field inputs. |
get_default_address_type() | Retrieve the default address type for this field. |
get_selected_address_type() | Returns the properties of the selected address type. |
get_state_field() | Generates state field markup. |
get_countries() | Returns a list of countries. |
get_default_countries() | Returns the default array of countries using the ISO 3166-1 alpha-2 code as the key to the country name. |
get_country_code() | Returns the ISO 3166-1 alpha-2 code for the supplied country name. |
get_country_codes() | Returns the default countries array updated to use the uppercase country name as the key to the ISO 3166-1 alpha-2 code. |
is_country_code() | Checks if the given value is an ISO 3166-1 alpha-2 country code that exists in our default list of countries. |
get_country_name() | Returns the country name for the given ISO 3166-1 alpha-2 country code. |
get_us_states() | Returns the array of US states and territories. |
get_default_us_states() | Returns the default array of US states using the 2-character state codes as the keys. |
get_us_state_code() | Returns the two-letter US state code from the state name provided. |
get_select_option() | Returns the option tag for the current choice. |
get_value_merge_tag() | Format the entry value for when the field/input merge tag is processed. Not called for the {all_fields} merge tag. |
get_value_entry_list() | Format the entry value for display on the entries list page. |
get_value_entry_detail() | Format the entry value for display on the entry detail page and for the {all_fields} merge tag. |
get_first_input_id() | Removes the "for" attribute in the field label. Inputs are only allowed one label (a11y) and the inputs already have labels. |
get_filter_sub_filters() | Returns the sub-filters for the current field. |
get_filter_operators() | Returns the filter operators for the current field. |
skip_state_validation_if_blank() | Indicates if state validation should be skipped if the submitted value is blank. |
get_values_for_state_hash() | Prepares the value that will be hashed on form display as part of the state. |
post_convert_field() | Actions to be performed after the field has been converted to an object. |
Method Reference
get_form_editor_field_description()
public function get_form_editor_field_description()
Returns the field's form editor description.
Returns
string
Since: 2.5
Source: includes/fields/class-gf-field-address.php:74
get_form_editor_field_icon()
public function get_form_editor_field_icon()
Returns the field's form editor icon.
This could be an icon url or a gform-icon class.
Returns
string
Since: 2.5
Source: includes/fields/class-gf-field-address.php:87
get_required_inputs_ids()
public function get_required_inputs_ids()
Defines the IDs of required inputs.
Returns
string[]
Since: 2.5
Source: includes/fields/class-gf-field-address.php:98
get_field_container_tag()
public function get_field_container_tag( $form )
Returns the HTML tag for the field container.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The current Form object. |
Returns
string
Since: 2.5
Source: includes/fields/class-gf-field-address.php:112
validate()
public function validate( $value, $form )
Validates the address field inputs.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | array | The field value from get_value_submission(). | |
$form | array | The Form Object currently being processed. |