gform_capsulecrm_person

Description

This filter allows the Capsule CRM Person object to be modified before it is created/updated.

Usage

The following would apply to 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. (format: gform_capsulecrm_person_FORMID)

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. (format: gform_capsulecrm_person_FORMID_FEEDID)

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

Parameters

  • $person array

    Capsule CRM person.

    array (
      'type' => 'person',
      'firstName' => 'TestFirst',
      'lastName' => 'TestLast',
      'about' => "New Person created by API',
      'jobTitle => '',
      'emailAddress' => 
        array (
          array(
            'address' => '[email protected]'
          )
        )
    )
        

  • $form Form Object

    The current form.

  • $entry Entry Object

    The current entry.

  • $feed Feed Object

    The current feed.

Examples

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;
}

Placement

This code should be placed in the functions.php file of your active theme.

Since

This filter was added in Gravity Forms Capsule CRM Add-On version 1.2.

Source Code

This filter is located in GFCapsuleCRM::create_person() in class-gf-capsulecrm.php.