Using Gravity Forms ‘gform_capsulecrm_person’ PHP filter

The gform_capsulecrm_person filter allows you to modify the Capsule CRM Person object before it is created or updated.

Usage

A generic example of how to use the filter for all forms:

add_filter('gform_capsulecrm_person', 'your_function_name', 10, 4);

To target a specific form, append the form ID to the hook name:

add_filter('gform_capsulecrm_person_1', 'your_function_name', 10, 4);

To target a specific feed for a form, append the form ID and feed ID to the hook name:

add_filter('gform_capsulecrm_person_1_7', 'your_function_name', 10, 4);

Parameters

  • $person (array): The Capsule CRM person object.
  • $form (Form Object): The current form.
  • $entry (Entry Object): The current entry.
  • $feed (Feed Object): The current feed.

More information

See Gravity Forms Docs: gform_capsulecrm_person

Examples

Modify the About section of a Capsule CRM person

This example modifies the ‘about’ section of the Capsule CRM person object before it is created or updated.

add_filter('gform_capsulecrm_person', 'change_person_object', 10, 4);

function change_person_object($person, $form, $entry, $feed){
    $person['about'] = 'Person Created by API';
    return $person;
}

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

Note: This filter was added in Gravity Forms Capsule CRM Add-On version 1.2. The filter is located in GFCapsuleCRM::create_person() in class-gf-capsulecrm.php.