Using Gravity Forms ‘gform_activecampaign_enable_tag_mapping’ PHP filter

The gform_activecampaign_enable_tag_mapping filter enables the display of the tags field in the Map Fields section of the ActiveCampaign feed.

Usage

To use the filter, add the following code to your theme’s functions.php file:

add_filter('gform_activecampaign_enable_tag_mapping', '__return_true');

Parameters

This filter does not have any parameters.

More information

See Gravity Forms Docs: gform_activecampaign_enable_tag_mapping

This filter was removed in ActiveCampaign 1.2 when the tags mapping setting was replaced by a tags text input with merge tag support. The filter can be found in the class-gf-activecampaign.php file.

Examples

Enabling tag mapping

Enable the display of the tags field in the Map Fields section of the ActiveCampaign feed.

add_filter('gform_activecampaign_enable_tag_mapping', '__return_true');

Disabling tag mapping

Disable the display of the tags field in the Map Fields section of the ActiveCampaign feed.

add_filter('gform_activecampaign_enable_tag_mapping', '__return_false');

Conditionally enabling tag mapping

Enable the display of the tags field in the Map Fields section of the ActiveCampaign feed only if a specific condition is met (e.g., current user is an administrator).

function enable_tag_mapping_for_admin() {
  if (current_user_can('administrator')) {
    return true;
  }
  return false;
}
add_filter('gform_activecampaign_enable_tag_mapping', 'enable_tag_mapping_for_admin');

Enabling tag mapping for a specific form

Enable the display of the tags field in the Map Fields section of the ActiveCampaign feed only for a specific form (e.g., form with ID 5).

function enable_tag_mapping_for_form_5($form) {
  if ($form['id'] == 5) {
    return true;
  }
  return false;
}
add_filter('gform_activecampaign_enable_tag_mapping', 'enable_tag_mapping_for_form_5');

Enabling tag mapping for multiple forms

Enable the display of the tags field in the Map Fields section of the ActiveCampaign feed for multiple forms (e.g., forms with IDs 3, 7, and 9).

function enable_tag_mapping_for_multiple_forms($form) {
  $allowed_forms = array(3, 7, 9);
  if (in_array($form['id'], $allowed_forms)) {
    return true;
  }
  return false;
}
add_filter('gform_activecampaign_enable_tag_mapping', 'enable_tag_mapping_for_multiple_forms');