Description
This filter allows the Capsule CRM Opportunity object to be modified before it is created.
Usage
The following would apply to all forms:
add_filter( 'gform_capsulecrm_opportunity', 'your_function_name', 10, 4 );
To target a specific form, append the form id to the hook name. (format: gform_capsulecrm_opportunity_FORMID)
add_filter( 'gform_capsulecrm_opportunity_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_opportunity_FORMID_FEEDID)
add_filter( 'gform_capsulecrm_opportunity_1_7', 'your_function_name', 10, 4 );
Parameters
- $opportunity array
Capsule CRM opportunity.
array ( 'name' => 'Capsule CRM', 'description' => 'Test Case', 'party' => array ( 'id' => 179884585 ), 'milestone' => array( 'name' => 'Meeting' ), '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_opportunity', 'change_opportunity_object', 10, 4 ); function change_opportunity_object( $opportunity, $form, $entry, $feed ){ $opportunity['description'] = 'Opportunity Created by API'; return $opportunity; }
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_opportunity() in class-gf-capsulecrm.php.