Gravity_Forms\Gravity_Forms\Settings\Fields\Generic_Map
Source: includes/settings/fields/class-generic-map.php:13
Details
- Kind:
class - Namespace:
Gravity_Forms\Gravity_Forms\Settings\Fields - Extends:
Base
Properties
| Property | Type | Description |
|---|---|---|
$type | string | Field type. |
$limit | int | Number of mappings allowed. |
$invalid_choices | array | Required choices that were not selected on save. |
$key_field | array | Key field properties. |
$value_field | array | Value field properties. |
Methods
| Method | Description |
|---|---|
__construct() | Initialize Generic Map field. |
markup() | Render field. |
get_container_classes() | Gets the classes to apply to the field container. |
populate_default_key_values() | Populate key field choices with their default mappings. |
get_value_choices() | Get choices for value field. |
do_validation() | Validate posted field value. |
get_required_choices() | Get choices that are required to be filled out. |
save() | Modify field value before saving. |
Method Reference
__construct()
public function __construct( $props, $settings )
Initialize Generic Map field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$props | array | Field properties. | |
$settings | \Gravity_Forms\Gravity_Forms\Settings\Settings | Settings framework instance. |
Since: 2.5
Source: includes/settings/fields/class-generic-map.php:85
markup()
public function markup()
Render field.
This contains the hidden input used to manage the state of the field and is also updated via react. This also contains the initializeFieldMap method which inits the react for the field and passes along the various props to then be used in the react app.
Returns
string
Since: 2.5
Source: includes/settings/fields/class-generic-map.php:229
get_container_classes()
public function get_container_classes()
Gets the classes to apply to the field container.
Removes invalid class.
Returns
string
Since: 2.5
Source: includes/settings/fields/class-generic-map.php:288
populate_default_key_values()
public function populate_default_key_values( $choices )
Populate key field choices with their default mappings.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$choices | array | Existing choices. |
Returns
array
Since: 2.5
Source: includes/settings/fields/class-generic-map.php:312
get_value_choices()
public function get_value_choices( $required_types=[], $excluded_types=[] )
Get choices for value field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$required_types | array | [] | Required field types. |
$excluded_types | array | [] | Excluded field types. |
Returns
array
Since: 2.5
Source: includes/settings/fields/class-generic-map.php:388
do_validation()
public function do_validation( $value )
Validate posted field value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | array | bool | string | Posted field value. |
Since: 2.5
Source: includes/settings/fields/class-generic-map.php:636
get_required_choices()
public function get_required_choices()
Get choices that are required to be filled out.
Returns
array
Since: 2.5
Source: includes/settings/fields/class-generic-map.php:685
save()
public function save( $value )
Modify field value before saving.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | array | bool | string |
Returns
array|bool|string
Since: 2.5
Source: includes/settings/fields/class-generic-map.php:727