GF_Field_Name
Class GF_Field_Name
Handles the behavior of the Name field.
Since: Unknown
Source: includes/fields/class-gf-field-name.php:15
Details
- Kind:
class - Namespace:
(global) - Extends: GF_Field
Properties
| Property | Type | Description |
|---|---|---|
$type | string | The type of field. |
$_supports_state_validation | bool | Indicates if this field supports state validation. |
Methods
| Method | Description |
|---|---|
get_field_container_tag() | Returns the HTML tag for the field container. |
get_form_editor_field_title() | Sets the field title of the Name field. |
get_form_editor_field_description() | Returns the field's form editor description. |
get_form_editor_field_icon() | Returns the field's form editor icon. |
is_conditional_logic_supported() | Defines if conditional logic is supported by the Name field. |
get_required_inputs_ids() | Defines the IDs of required inputs. |
validate() | Validates Name field inputs. |
get_form_editor_field_settings() | Defines the field settings available for the Name field in the form editor. |
get_field_input() | Gets the HTML markup for the field input. |
get_css_class() | Sets the CSS class to be used by the field input. |
get_name_prefix_field() | Defines the field markup to be used for the name prefix. |
get_value_entry_detail() | Gets the field value to be displayed on the entry detail page. |
sanitize_settings() | Sanitizes the field settings choices. |
get_value_export() | Gets the field value to be used when exporting. |
get_first_input_id() | Removes the "for" attribute in the field label. Inputs are only allowed one label (a11y) and the inputs already have labels. |
get_filter_sub_filters() | Returns the sub-filters for the current field. |
get_filter_operators() | Returns the filter operators for the current field. |
is_state_validation_supported() | Determines if this field will be processed by the state validation. |
get_values_for_state_hash() | Prepares the value that will be hashed on form display as part of the state. |
skip_state_validation_if_blank() | Indicates if state validation should be skipped if the submitted value is blank. |
Method Reference
get_field_container_tag()
public function get_field_container_tag( $form )
Returns the HTML tag for the field container.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The current Form object. |
Returns
string
Since: 2.5
Source: includes/fields/class-gf-field-name.php:45
get_form_editor_field_title()
public function get_form_editor_field_title()
Sets the field title of the Name field.
Returns
string
Since: Unknown
Source: includes/fields/class-gf-field-name.php:66
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-name.php:77
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-name.php:90
is_conditional_logic_supported()
public function is_conditional_logic_supported()
Defines if conditional logic is supported by the Name field.
Returns
bool— true
Since: Unknown
Source: includes/fields/class-gf-field-name.php:105
get_required_inputs_ids()
public function get_required_inputs_ids()
Defines the IDs of required inputs.
Returns
string[]
Since: 2.5
Source: includes/fields/class-gf-field-name.php:116
validate()
function validate( $value, $form )
Validates Name field inputs.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | array | string | The value of the field to validate. Not used here. | |
$form | array | The Form Object. Not used here. |
Returns
void
Since:
1.92.6.5(Updated to use set_required_error().)
Source: includes/fields/class-gf-field-name.php:140
get_form_editor_field_settings()
function get_form_editor_field_settings()
Defines the field settings available for the Name field in the form editor.
Returns
array— The field settings available.
Since: Unknown
Source: includes/fields/class-gf-field-name.php:156
get_field_input()
public function get_field_input( $form, $value='', $entry=null )
Gets the HTML markup for the field input.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The Form Object. | |
$value | string | '' | The value of the field. Defaults to empty string. |
$entry | array | null | null | The Entry Object. Defaults to null. |
Returns
string— The HTML markup for the field input.
Since: Unknown
Source: includes/fields/class-gf-field-name.php:203
get_css_class()
public function get_css_class()
Sets the CSS class to be used by the field input.
Returns
string— The CSS class to use for the field.
Since: Unknown
Source: includes/fields/class-gf-field-name.php:465
get_name_prefix_field()
public function get_name_prefix_field( $input, $id, $field_id, $value, $disabled_text, $tabindex )
Defines the field markup to be used for the name prefix.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$input | array | The input item choices. | |
$id | int | The ID of the name field. | |
$field_id | int | The field ID of the name field. | |
$value | string | The value to be used in the prefix field item. | |
$disabled_text | string | The text to be used if the prefix field item is disabled. | |
$tabindex | int | The tab index of the prefix field item. |
Returns
string— The field HTML markup.
Since: Unknown
Source: includes/fields/class-gf-field-name.php:535
get_value_entry_detail()
public function get_value_entry_detail( $value, $entry=[], $use_text=false, $format='html', $media='screen' )
Gets the field value to be displayed on the entry detail page.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | array | string | The value of the field input. | |
$entry | array | [] | Not used. |
$use_text | bool | false | Not used. |
$format | string | 'html' | The format to output the value. Defaults to 'html'. |
$media | string | 'screen' | Not used. |
Returns
array|string— The value to be displayed on the entry detail page.
Since:
Unknown2.9.29(Changed the second parameter $currency (string) to $entry (array).)
Source: includes/fields/class-gf-field-name.php:580
sanitize_settings()
public function sanitize_settings()
Sanitizes the field settings choices.
Returns
void
Since: Unknown
Source: includes/fields/class-gf-field-name.php:619
get_value_export()
public function get_value_export( $entry, $input_id='', $use_text=false, $is_csv=false )
Gets the field value to be used when exporting.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | The Entry Object. | |
$input_id | string | '' | The input ID to format. Defaults to empty string. If not set, uses t |
$use_text | bool | false | Not used. |
$is_csv | bool | false | Not used. |
Returns
string— The field value.
Since: Unknown
Source: includes/fields/class-gf-field-name.php:647
get_first_input_id()
public function get_first_input_id( $form )
Removes the "for" attribute in the field label. Inputs are only allowed one label (a11y) and the inputs already have labels.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The Form Object currently being processed. |
Returns
string
Since: 2.4
Source: includes/fields/class-gf-field-name.php:689
get_filter_sub_filters()
public function get_filter_sub_filters()
Returns the sub-filters for the current field.
Returns
array
Since: 2.4
Source: includes/fields/class-gf-field-name.php:702
get_filter_operators()
public function get_filter_operators()
Returns the filter operators for the current field.
Returns
array
Since: 2.4
Source: includes/fields/class-gf-field-name.php:734
is_state_validation_supported()
public function is_state_validation_supported()
Determines if this field will be processed by the state validation.
Returns
bool
Since: 3.0
Source: includes/fields/class-gf-field-name.php:748
get_values_for_state_hash()
public function get_values_for_state_hash( $value )
Prepares the value that will be hashed on form display as part of the state.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | array | The default value. |
Returns
null|array
Since: 3.0
Source: includes/fields/class-gf-field-name.php:761
skip_state_validation_if_blank()
public function skip_state_validation_if_blank( $key )
Indicates if state validation should be skipped if the submitted value is blank.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$key | string | int | The field or input ID. |
Returns
bool
Since: 3.0
Source: includes/fields/class-gf-field-name.php:783