GravityExport field: SeparableField
A bunch of form fields are multipart fields. Fields like name ย , address ย , creditcard ย ย all have multiple inputs, and can therefor be either in a single column, combined by a newline, or be split up into multiple columns. This class is responsible for splitting up these inputs in to multiple columns.
The Transformer ย ย checks if a field has multiple inputs, and if so chooses SeparableField ย ย by default.
Filters #
gfexcel_field_separated_{type}_{form_id}_{field_id}ยUsing this filter you can enable or disable the separability of a specific field. Just use the
__return_trueย ย and__return_falseย ย functions from WordPress for this.gfexcel_field_label_{type}_{form_id}_{field_id}ยThis filter is a default filter for all fields, but here it can be used to manipulate the label for every column. By default the label is the same as the field name, unless youโve provided a custom label on the field.
gfexcel_field_value_{type}_{form_id}_{field_id}ยThis filter is also the default filter for a field, but it now also targets every column available for this field.
gfexcel_field_*type*_fieldsยThis is a bit of an odd (named) filter. You can use it to change the input this field has. But because the
typeย ย is actually necessary to target the correct field, this isnโt an optional piece. Thatโs why Iโve contained it IN the name of the filter. So just update*type*ย ย to something likeaddressย ย ornameย .
Example #
add_filter('gfexcel_field_address_fields', function( $fields, $entry ) {
//manipulate these fields
return $fields;
}, 10, 2);Extendability #
This class is the base for all multiple input fields, and it is great for extension if you have a (custom) separable field. Please see ProductField, as this is an extension of SeparableField ย .