Using Gravity Forms ‘gform_zohocrm_task’ PHP filter

The gform_zohocrm_task filter allows you to modify the task arguments before they are sent to Zoho CRM.

Usage

To apply this filter to all feeds:

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

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

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

Parameters

  • $task (array): The task arguments as an associative array.
  • $feed (Feed Object): The feed currently being processed.
  • $entry (Entry Object): The entry currently being processed.
  • $form (Form Object): The form currently being processed.

More information

See Gravity Forms Docs: gform_zohocrm_task

The source code for this filter is located in GFZohoCRM::create_task() in class-gf-zohocrm.php.

Examples

Append text to Subject

This example demonstrates how to append text to the ‘Subject’ argument based on a field value in the Entry Object.

add_filter('gform_zohocrm_task_4', 'change_task_argument', 10, 4);

function change_task_argument($task, $feed, $entry, $form) {
    if (rgars($feed, 'meta/feedName') == 'Zoho CRM Feed 2' && rgar($entry, '5') == 'No') {
        $task['Subject'] .= ' - some more text';
    }

    return $task;
}