Gravity_Forms\Gravity_Forms\Settings\Fields\Select
Source: includes/settings/fields/class-select.php:9
Details
- Kind:
class - Namespace:
Gravity_Forms\Gravity_Forms\Settings\Fields - Extends:
Base
Properties
| Property | Type | Description |
|---|---|---|
$type | string | Field type. |
$choices | array | Field choices. |
$no_choices | string | Message to display when no choices exist. |
$enhanced_ui | bool | Enable enhanced UI with Select2. |
$after_select | string | Field content after select. |
Methods
| Method | Description |
|---|---|
scripts() | Register scripts to enqueue when displaying field. |
markup() | Render field. |
get_options() | Prepares an array of choices as an HTML string of options. |
do_validation() | Validate posted field value. |
support_multiple() | Determine if a select field supports multiple choices. |
Method Reference
scripts()
public function scripts()
Register scripts to enqueue when displaying field.
Returns
array
Since: 2.5
Source: includes/settings/fields/class-select.php:65
markup()
public function markup()
Render field.
Returns
string
Since: 2.5
Source: includes/settings/fields/class-select.php:92
get_options()
public static function get_options( $choices, $selected )
Prepares an array of choices as an HTML string of options.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$choices | array | Array of drop down choices. | |
$selected | string | Currently selected value. |
Returns
string
Since: 2.5
Source: includes/settings/fields/class-select.php:164
do_validation()
public function do_validation( $value )
Validate posted field value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | array | Posted field value. |
Since: 2.5
Source: includes/settings/fields/class-select.php:225
support_multiple()
public function support_multiple()
Determine if a select field supports multiple choices.
Returns
bool— true if the field supports multiple choices, false if not.
Since: 2.5
Source: includes/settings/fields/class-select.php:316