Gravity_Forms\Gravity_Forms\Settings\Fields\Checkbox_And_Select
Source: includes/settings/fields/class-checkbox-and-select.php:13
Details
- Kind:
class - Namespace:
Gravity_Forms\Gravity_Forms\Settings\Fields - Extends:
Base
Properties
| Property | Type | Description |
|---|---|---|
$type | string | Field type. |
$inputs | Base[] | Child inputs. |
Methods
| Method | Description |
|---|---|
__construct() | Initialize Checkbox and Select field. |
markup() | Render field. |
get_values_from_post() | Get the correctly-grouped values from $_POST for use in validation. |
save_field() | Filter out unneeded select values when the checkbox isn't checked. |
do_validation() | Validate posted field value. |
Method Reference
__construct()
public function __construct( $props, $settings )
Initialize Checkbox and Select field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$props | array | Field properties. | |
$settings | \Gravity_Forms\Gravity_Forms\Settings\Settings | Settings instance. |
Since: 2.5
Source: includes/settings/fields/class-checkbox-and-select.php:41
markup()
public function markup()
Render field.
Returns
string
Since: 2.5
Source: includes/settings/fields/class-checkbox-and-select.php:106
get_values_from_post()
public function get_values_from_post( $values )
Get the correctly-grouped values from $_POST for use in validation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$values | array | The $_POST values. |
Returns
array
Since: 2.5
Source: includes/settings/fields/class-checkbox-and-select.php:139
save_field()
public function save_field( $field_values, $field_value )
Filter out unneeded select values when the checkbox isn't checked.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field_values | array | Posted field values. | |
$field_value | array | bool | string | Posted value for field. |
Returns
array
Since: 2.5
Source: includes/settings/fields/class-checkbox-and-select.php:165
do_validation()
public function do_validation( $values )
Validate posted field value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$values | array | Posted field values. |
Since: 2.5-beta-3
Source: includes/settings/fields/class-checkbox-and-select.php:187