GF_Field_Number
Source: includes/fields/class-gf-field-number.php:8
Details
- Kind:
class - Namespace:
(global) - Extends: GF_Field
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. |
clean_value() | Ensures the POST value is in the correct number format. |
is_value_empty() | Is the given value considered empty for this field. |
get_value_merge_tag() | Gets merge tag values. |
get_value_save_input() | Sanitize and format the value before it is saved to the Entry 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-number.php:23
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-number.php:36
clean_value()
public function clean_value( $value )
Ensures the POST value is in the correct number format.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value |
Returns
bool|float|string
Since: 2.4
Source: includes/fields/class-gf-field-number.php:98
is_value_empty()
public function is_value_empty( $value )
Is the given value considered empty for this field.
Adds a check to the parent method because a value of 0 returns a false positive.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value |
Returns
bool
Since: 2.7.1
Source: includes/fields/class-gf-field-number.php:151
get_value_merge_tag()
public function get_value_merge_tag( $value, $input_id, $entry, $form, $modifier, $raw_value, $url_encode, $esc_html, $format, $nl2br )
Gets merge tag values.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | array | string | The value of the input. | |
$input_id | string | The input ID to use. | |
$entry | array | The Entry Object. | |
$form | array | The Form Object | |
$modifier | string | The modifier passed. | |
$raw_value | array | string | The raw value of the input. | |
$url_encode | bool | If the result should be URL encoded. | |
$esc_html | bool | If the HTML should be escaped. | |
$format | string | The format that the value should be. | |
$nl2br | bool | If the nl2br function should be used. |
Returns
string— The processed merge tag.
Since: Unknown
Source: includes/fields/class-gf-field-number.php:309
get_value_save_input()
public function get_value_save_input( $value, $form, $input_name, $entry_id, $entry, $repeater_index='' )
Sanitize and format the value before it is saved to the Entry Object.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | The value to be saved. | |
$form | array | The Form object currently being processed. | |
$input_name | string | The input name used when accessing the $_POST. | |
$entry_id | int | The ID of the entry currently being processed. | |
$entry | array | The entry currently being processed. | |
$repeater_index | string | '' | The repeater index if the field is inside a repeater. |
Returns
array|string— The sanitized and formatted input value to be saved.
Since: 3.0.0
Source: includes/fields/class-gf-field-number.php:341