Description
This filter allows the Capsule CRM Case object to be modified before it is created.
Usage
The following would apply to all forms:
add_filter( 'gform_capsulecrm_case', 'your_function_name', 10, 4 );
To target a specific form, append the form id to the hook name. (format: gform_capsulecrm_case_FORMID)
add_filter( 'gform_capsulecrm_case_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_case_FORMID_FEEDID)
add_filter( 'gform_capsulecrm_case_1_7', 'your_function_name', 10, 4 );
Parameters
- $case array
Capsule CRM case.
array ( 'name' => 'Capsule CRM', 'description' => 'Test Case', 'status' => 'OPEN', 'party' => array ( 'id' => 179884585, 'owner' => array ( 'username' => 'testuser' ) ) )
-
$form Form Object
The current form.
-
$entry Entry Object
The current entry.
-
$feed Feed Object
The current feed.
Examples
add_filter( 'gform_capsulecrm_case', 'change_case_object', 10, 4 ); function change_case_object( $case, $form, $entry, $feed ){ $case['description'] = 'Created by API'; return $case; }
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_case() in class-gf-capsulecrm.php.