Using Gravity Forms ‘gform_activecampaign_supported_field_types_email_map’ PHP filter

The gform_activecampaign_supported_field_types_email_map filter allows you to map different field types to ActiveCampaign’s email field.

Usage

To apply the filter to all forms, use the following code:

add_filter('gform_activecampaign_supported_field_types_email_map', 'your_function_name');

Parameters

  • $field_types (array | bool): An array of field types or “true” for all field types.

More information

See Gravity Forms Docs: gform_activecampaign_supported_field_types_email_map

This filter was introduced in ActiveCampaign 1.5.

Examples

Allow Text Field Type for Mapping

Add a text field type for mapping to ActiveCampaign’s email field:

add_filter('gform_activecampaign_supported_field_types_email_map', function($field_types) {
    return array('email', 'hidden', 'text');
});

Place this code in the functions.php file of your active theme.

Allow All Field Types for Mapping

To allow all field types for mapping, return true:

add_filter('gform_activecampaign_supported_field_types_email_map', function($field_types) {
    return true;
});

Add a Custom Field Type for Mapping

Add a custom field type, for example “custom_email”, for mapping:

add_filter('gform_activecampaign_supported_field_types_email_map', function($field_types) {
    return array('email', 'hidden', 'custom_email');
});

Allow Only Hidden Field Type for Mapping

To allow only the hidden field type for mapping, update the array:

add_filter('gform_activecampaign_supported_field_types_email_map', function($field_types) {
    return array('hidden');
});

Remove Hidden Field Type from Mapping

To remove the hidden field type from mapping and keep only the email field type:

add_filter('gform_activecampaign_supported_field_types_email_map', function($field_types) {
    return array('email');
});