GF_Field_CreditCard
Source: includes/fields/class-gf-field-creditcard.php:8
Details
- Kind:
class - Namespace:
(global) - Extends: GF_Field
Properties
| Property | Type | Description |
|---|---|---|
$duplicatable | bool | Whether there can be more than one of this field type per form. |
$repeatable | bool | Whether the field can be used in a repeater. |
$is_payment | bool | Indicates the field is used to capture payments. |
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_required_inputs_ids() | Defines the IDs of required inputs. |
get_inputs_describedby_attributes() | Generates an array that contains aria-describedby attribute for each input. |
get_field_container_tag() | Returns the HTML tag for the field container. |
get_field_content() | Displays an insecure page warning below the field content. |
get_value_entry_detail() | Format the entry value for display on the entry detail page and for the {all_fields} merge tag. |
get_value_save_input() | Sanitize and format the value before it is saved to the Entry Object. |
post_convert_field() | Upgrades inputs, if needed. |
maybe_upgrade_inputs() | GF1.8 and earlier used 5 inputs (1 input for the expiration date); GF1.9 changed to 6 inputs (the expiration month and year now separate); upgrade those fields still using the older configuration. |
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-creditcard.php:50
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-creditcard.php:63
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-creditcard.php:98
get_inputs_describedby_attributes()
public function get_inputs_describedby_attributes( $required_inputs_ids, $values )
Generates an array that contains aria-describedby attribute for each input.
Depending on each input's validation state, aria-describedby takes the value of the validation message container ID, the description only or nothing.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$required_inputs_ids | array | IDs of required field inputs. | |
$values | array | string | Inputs values. |
Returns
array
Since: 2.5
Source: includes/fields/class-gf-field-creditcard.php:114
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-creditcard.php:194
get_field_content()
public function get_field_content( $value, $force_frontend_label, $form )
Displays an insecure page warning below the field content.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | string | array | The field value. From default/dynamic population, $_POST, or a resumed incomplete submission. | |
$force_frontend_label | bool | Should the frontend label be displayed in the admin even if an admin label is configured. | |
$form | array | The Form Object currently being processed. |
Returns
string
Since: 2.5
Source: includes/fields/class-gf-field-creditcard.php:215
get_value_entry_detail()
public function get_value_entry_detail( $value, $entry=[], $use_text=false, $format='html', $media='screen' )
Format the entry value for display 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-creditcard.php:539
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-creditcard.php:612
post_convert_field()
public function post_convert_field()
Upgrades inputs, if needed.
Returns
void
See Also
Since: 2.1.2.7
Source: includes/fields/class-gf-field-creditcard.php:648
maybe_upgrade_inputs()
public function maybe_upgrade_inputs()
GF1.8 and earlier used 5 inputs (1 input for the expiration date); GF1.9 changed to 6 inputs (the expiration month and year now separate); upgrade those fields still using the older configuration.
Source: includes/fields/class-gf-field-creditcard.php:656