GF_Field_Phone
Class GF_Field_Phone
Handles the behavior of Phone fields.
Since: Unknown
Source: includes/fields/class-gf-field-phone.php:15
Details
- Kind:
class - Namespace:
(global) - Extends: GF_Field
Properties
| Property | Type | Description |
|---|---|---|
$type | string | The field type. |
Methods
| Method | Description |
|---|---|
get_form_editor_field_title() | Defines the field title to be used in the form editor. |
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_form_editor_field_settings() | Defines the field settings available within the field editor. |
is_conditional_logic_supported() | Defines if conditional logic is supported in this field type. |
get_field_placeholder_attribute() | Returns the placeholder attribute for the field. |
get_field_container_tag() | Returns the HTML tag for the field container. |
validate() | Validates inputs for the Phone field. |
get_field_css_class() | Get field CSS class. |
get_field_input() | Returns the field input. |
get_value_submission() | Gets the value of the submitted field. |
sanitize_entry_value() | Sanitizes the entry value. |
get_value_save_input() | Sanitize and format the value before it is saved to the Entry Object. |
get_value_entry_detail() | Gets the value to be displayed on the entry detail page. |
get_value_entry_list() | Gets the value to be displayed on the entries list page. |
get_value_merge_tag() | Gets the merge tag value. |
get_value_export() | Gets the value to be used when exporting the entry. |
sanitize_settings() | Sanitizes the field settings. |
get_phone_formats() | Get an array of phone formats. |
get_phone_format() | Get the properties for the fields selected phone format. |
Method Reference
get_form_editor_field_title()
public function get_form_editor_field_title()
Defines the field title to be used in the form editor.
Returns
string— The field title. Translatable and escaped.
Since: Unknown
Source: includes/fields/class-gf-field-phone.php:37
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-phone.php:48
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-phone.php:61
get_form_editor_field_settings()
function get_form_editor_field_settings()
Defines the field settings available within the field editor.
Returns
array— The field settings available for the field.
Since: Unknown
Source: includes/fields/class-gf-field-phone.php:73
is_conditional_logic_supported()
public function is_conditional_logic_supported()
Defines if conditional logic is supported in this field type.
Returns
bool— true
Since: Unknown
Source: includes/fields/class-gf-field-phone.php:109
get_field_placeholder_attribute()
public function get_field_placeholder_attribute()
Returns the placeholder attribute for the field.
If no custom placeholder is set and the phone format has a mask, uses the mask as placeholder.
Returns
string
Since: next
Source: includes/fields/class-gf-field-phone.php:122
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: 3.0.0
Source: includes/fields/class-gf-field-phone.php:142
validate()
public function validate( $value, $form )
Validates inputs for the Phone field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | array | string | The field value to be validated. | |
$form | array | The Form Object. |
Returns
void
Since: Unknown
Source: includes/fields/class-gf-field-phone.php:172
get_field_css_class()
public function get_field_css_class()
Get field CSS class.
Returns
string
Source: includes/fields/class-gf-field-phone.php:232
get_field_input()
public function get_field_input( $form, $value='', $entry=null )
Returns the field input.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The Form Object. | |
$value | string | '' | The value of the input. Defaults to empty string. |
$entry | null | array | null | The Entry Object. Defaults to null. |
Returns
string— The HTML markup for the field.
Since: Unknown
Source: includes/fields/class-gf-field-phone.php:257
get_value_submission()
public function get_value_submission( $field_values, $get_from_post_global_var=true )
Gets the value of the submitted field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field_values | array | The dynamic population parameter names with their corresponding values to be populated. | |
$get_from_post_global_var | bool | true | Whether to get the value from the $_POST array as opposed to $field_values. Defaults to true. |
Returns
array|string
Since: Unknown
Source: includes/fields/class-gf-field-phone.php:585
sanitize_entry_value()
public function sanitize_entry_value( $value, $form_id )
Sanitizes the entry value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | The value to be sanitized. | |
$form_id | int | The form ID of the submitted item. |
Returns
array|array[]|string[]— The sanitized value.
Since: Unknown
Source: includes/fields/class-gf-field-phone.php:607
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-phone.php:634
get_value_entry_detail()
public function get_value_entry_detail( $value, $currency='', $use_text=false, $format='html', $media='screen' )
Gets the value to be displayed on the entry detail page.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | The field value. | |
$currency | string | '' | The entry currency code. |
$use_text | bool | false | When processing merge tags, etc. |
$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. |
Returns
string
Source: includes/fields/class-gf-field-phone.php:701
get_value_entry_list()
public function get_value_entry_list( $value, $entry, $field_id, $columns, $form )
Gets the value to be displayed on the entries list page.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | The field value. | |
$entry | array | The Entry Object. | |
$field_id | string | The field ID. | |
$columns | array | The columns to be displayed. | |
$form | array | The Form Object. |
Returns
string
Source: includes/fields/class-gf-field-phone.php:729
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 the merge tag value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | The merge tag value to be filtered. | |
$input_id | string | The field or input ID from the merge tag. | |
$entry | array | The Entry Object. | |
$form | array | The Form Object. | |
$modifier | string | The merge tag modifier. | |
$raw_value | string | The raw field value from before formatting. | |
$url_encode | bool | Whether to encode the value for URLs. | |
$esc_html | bool | Whether to encode HTML entities. | |
$format | string | The format requested for the location the merge is being used. | |
$nl2br | bool | Whether to convert newlines to HTML line breaks. |
Returns
string
Source: includes/fields/class-gf-field-phone.php:759
get_value_export()
public function get_value_export( $entry, $input_id='', $use_text=false, $is_csv=false )
Gets the value to be used when exporting the entry.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | The Entry Object. | |
$input_id | string | '' | The field or input ID. |
$use_text | bool | false | Whether to use the text value. |
$is_csv | bool | false | Whether the export is for CSV. |
Returns
string
Source: includes/fields/class-gf-field-phone.php:790
sanitize_settings()
public function sanitize_settings()
Sanitizes the field settings.
Returns
void
Since: Unknown
Source: includes/fields/class-gf-field-phone.php:821
get_phone_formats()
public function get_phone_formats( $form_id=null )
Get an array of phone formats.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | null | int | null | The ID of the current form or null to use the value from the current fields form_id property. Defaults to null. |
Returns
array— The phone formats available.
Since: Unknown
Source: includes/fields/class-gf-field-phone.php:845
get_phone_format()
public function get_phone_format()
Get the properties for the fields selected phone format.
Returns
array— The phone format.
Since: Unknown
Source: includes/fields/class-gf-field-phone.php:898