GF_Field_Repeater
The Repeater field.
2.4
Class GF_Field_Repeater
Source: includes/fields/class-gf-field-repeater.php:14
Details
- Kind:
class - Namespace:
(global) - Extends: GF_Field
Properties
| Property | Type | Description |
|---|---|---|
$repeatable | bool | Whether the field can be used in a repeater. |
Methods
| Method | Description |
|---|---|
__construct() | Repeater field constructor. |
get_form_editor_field_title() | Returns the field title for the form editor. |
get_form_editor_field_description() | Returns the field description for the form editor. |
get_form_editor_field_icon() | Returns the field icon for the form editor. |
get_form_editor_field_settings() | Returns the field settings for the form editor. |
is_value_submission_empty() | Used to determine the required validation result. |
is_value_empty() | A repeater value is empty when every sub-field in every row is empty. |
should_show_validation_error() | Whether this field should show a validation error in the markup. |
validate() | Validates each sub-field. |
set_sub_field_validation_result() | Populates the sub field repeater_validation_results context property with the validation result for the given index. |
get_sub_field_default_value() | Applies a sub field's default value to each submitted row of the repeater. This is used by administrative fields inside a repeater. |
get_value_submission() | Retrieve the field value on submission. |
get_value_submission_recursive() | Returns the submission values for the repeater. |
get_value_create_entry() | Returns the repeater value in the format expected by create_lead(). Sanitize each child value for saving and fire gform_save_field_value filter. |
get_field_container_tag() | Returns the HTML tag for the field container. |
get_field_input() | Returns the field inner markup. |
get_form_editor_field_message() | Display a message in the form editor if a field has been added programmatically and cannot be edited. |
get_empty_wrapper() | Generates the HTML for the empty state of the repeater list. |
get_input_top() | Returns the markup for the top of the repeater container. |
get_input_items() | Returns the markup for the items. |
get_repeater_row() | Returns the markup for a single repeater row. |
restore_sub_field_validation_result() | Populates the sub field properties with the cached validation result for the current index. |
has_field_failed_validation() | Determines whether a sub-field failed validation in any repeater row. |
get_input_bottom() | Return the markup for the bottom of the repeater. Close the tags opened in the top. |
get_buttons() | Returns the repeater buttons. |
get_default_button_text() | Returns the default button text for the repeater add/remove buttons. |
get_limit_message() | Return the maximum number of repeats description. |
get_limit_message_text() | Get the description for the maximum number of repeats, otherwise return blank. |
get_repeater_row_label() | Returns the row label for individual repeats of the repeater. |
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. |
get_value_all_fields_merge_tag() | Returns the field value formatted for the {all_fields} merge tag. |
get_value_recursive() | Format the entry value safe for displaying on the entry detail page and for the {all_fields} merge tag. |
has_product_fields() | Checks if the repeater contains a product field at any nesting level. |
has_only_product_fields() | Checks if the repeater only contains product/pricing fields recursively. |
filter_fields() | Filters sub-fields to those for which the callback returns true, including fields nested in child repeaters. |
get_field_value() | Returns the value for a field inside a repeater. |
get_field_rows() | Searches $repeater_value for data associated with the specified $field. $field can be a top level field or nested. |
update_input_value() | Updates an input anywhere it is stored in a repeater value, including inside nested repeaters. |
get_sub_field_input() | Returns the input markup for a field inside a repeater. |
validate_subfield() | Validates the sub field. |
get_sub_field_content() | Returns the markup for the sub field. |
hydrate() | Builds the repeater's array of items. |
get_repeater_items() | Recursively converts the repeater values from flattened values in the entry array into a multidimensional array |
empty_deep() | Recursively checks whether a multi-dimensional array is empty. |
get_filter_sub_filters() | Returns the sub-filters for the current field. |
get_filter_settings() | Returns the filter settings for the current field. |
get_value_export() | Format the entry value before it is used in entry exports and by framework add-ons using GFAddOn::get_field_value(). |
get_value_export_recursive() | Format the entry value before it is used in entry exports and by framework add-ons using GFAddOn::get_field_value(). |
set_modifiers() | Store the modifiers so they can be accessed when preparing the {all_fields} and field merge tag output. |
Method Reference
__construct()
public function __construct( $properties=[] )
Repeater field constructor.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$properties | [] |
Since: 3.0
Source: includes/fields/class-gf-field-repeater.php:32
get_form_editor_field_title()
public function get_form_editor_field_title()
Returns the field title for the form editor.
Returns
string
Since: 2.4
Source: includes/fields/class-gf-field-repeater.php:68
get_form_editor_field_description()
public function get_form_editor_field_description()
Returns the field description for the form editor.
Returns
string
Since: 3.0
Source: includes/fields/class-gf-field-repeater.php:79
get_form_editor_field_icon()
public function get_form_editor_field_icon()
Returns the field icon for the form editor.
Returns
string
Since: 3.0
Source: includes/fields/class-gf-field-repeater.php:90
get_form_editor_field_settings()
public function get_form_editor_field_settings()
Returns the field settings for the form editor.
Returns
array
Since: 2.4
Source: includes/fields/class-gf-field-repeater.php:101
is_value_submission_empty()
public function is_value_submission_empty( $form_id )
Used to determine the required validation result.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | int | The ID of the form currently being processed. |
Returns
bool
Since: 2.4
Source: includes/fields/class-gf-field-repeater.php:126
is_value_empty()
public function is_value_empty( $value )
A repeater value is empty when every sub-field in every row is empty.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$value | null | array | The field value. |
Returns
bool— Returns true if every field in the repeater is blank. Returns false otherwise.
Since: 3.0
Source: includes/fields/class-gf-field-repeater.php:139
should_show_validation_error()
public function should_show_validation_error()
Whether this field should show a validation error in the markup.
Repeater fields keep failed_validation for their subfields, and do not show the error class or message themselves.