The gform_helpscout_tags filter allows you to modify the tags created for a Help Scout conversation.
Usage
To apply this filter to all forms:
add_filter('gform_helpscout_tags', 'your_function_name', 10, 4);
To apply this filter to a specific form:
add_filter('gform_helpscout_tags_4', 'your_function_name', 10, 4);
Parameters
$tags(array): An array of tags to be assigned to the conversation.$feed(Feed Object): The current feed object.$entry(Entry Object): The current entry object.$form(Form Object): The current form object.
More information
See Gravity Forms Docs: gform_helpscout_tags
Examples
Add license type as tag
This example retrieves the license type associated with a user’s metadata and adds it as a tag.
add_filter('gform_helpscout_tags', 'add_license_tag', 10, 4);
function add_license_tag($tags, $feed, $entry, $form) {
global $current_user;
get_currentuserinfo();
$license_type = get_user_meta($current_user->ID, 'license_type', 'No License');
$tags[] = $license_type;
return $tags;
}
Place this code in the functions.php file of your active theme.