GF_Field_Text
Source: includes/fields/class-gf-field-text.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. |
get_field_placeholder_attribute() | Returns the placeholder attribute for the field. |
validate() | Return the result (bool) by setting $this->failed_validation. |
get_text_counter_attrs() | Returns the text counter attributes if maxLength is set. |
get_value_merge_tag() | Gets merge tag values. |
get_value_entry_list() | Format the entry value safe for displaying on the entry list page. |
get_value_entry_detail() | Format the entry value safe for displaying on the entry detail page and for the {all_fields} merge tag. |
get_aria_describedby() | Add the hint text to aria-describedby. |
get_filter_operators() | Returns the filter operators for the current field. |
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-text.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-text.php:36
get_field_placeholder_attribute()
public function get_field_placeholder_attribute()
Returns the placeholder attribute for the field.
If no custom placeholder is set and an input mask is enabled, uses the mask as placeholder.
Returns
string
Since: next
Source: includes/fields/class-gf-field-text.php:76
validate()
public function validate( $value, $form )
Return the result (bool) by setting $this->failed_validation.
Return the validation message (string) by setting $this->validation_message.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | array | The field value from get_value_submission(). | |
$form | array | The Form Object currently being processed. |
Since: 2.4.11
Source: includes/fields/class-gf-field-text.php:93
get_text_counter_attrs()
public static function get_text_counter_attrs( $field )
Returns the text counter attributes if maxLength is set.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | GF_Field | The field object. |
Returns
string— The text counter attributes or an empty string if text counter is not enabled.
Since: 2.9.20
Source: includes/fields/class-gf-field-text.php:173
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-text.php:227
get_value_entry_list()
public function get_value_entry_list( $value, $entry, $field_id, $columns, $form )
Format the entry value safe for displaying on the entry list page.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | The field value. | |
$entry | array | The Entry Object currently being processed. | |
$field_id | string | The field or input ID currently being processed. | |
$columns | array | The properties for the columns being displayed on the entry list page. | |
$form | array | The Form Object currently being processed. |
Returns
string
Since: Unknown
Source: includes/fields/class-gf-field-text.php:268
get_value_entry_detail()
public function get_value_entry_detail( $value, $entry=[], $use_text=false, $format='html', $media='screen' )
Format the entry value safe for displaying on the entry detail page and for the {all_fields} merge tag.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | array | The field value. | |
$entry | array | [] | The entry. |
$use_text | bool | false | false | When processing choice based fields should the choice text be returned instead of the value. |
$format | string | 'html' | The format requested for the location the merge is being used. Possible values: html, text or url. |
$media | string | 'screen' | The location where the value will be displayed. Possible values: screen or email. |
Returns
string
Since:
1.92.9.29(Changed the second parameter $currency (string) to $entry (array).)
Source: includes/fields/class-gf-field-text.php:302