Description
This filter allows the Capsule CRM Task object to be modified before it is created.
Usage
The following would apply to all forms:
add_filter( 'gform_capsulecrm_task', 'your_function_name', 10, 4 );
To target a specific form, append the form id to the hook name. (format: gform_capsulecrm_task_FORMID)
add_filter( 'gform_capsulecrm_task_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_task_FORMID_FEEDID)
add_filter( 'gform_capsulecrm_task_1_7', 'your_function_name', 10, 4 );
Parameters
- $task array
Capsule CRM task.
array ( 'description' => 'Capsule CRM', 'detail' => 'Task Created by API', 'lastName' => 'TestLast', 'dueOn' => '2019-02-14', 'dueTime => '21:25:08', 'status' => 'OPEN', 'category' => array( 'name' => 'Follow-up' ), '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_task', 'change_task_object', 10, 4 ); function change_task_object( $task, $form, $entry, $feed ){ $task['description'] = 'Task Created by API'; return $task; }
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_task() in class-gf-capsulecrm.php.