gform_helpscout_tags

gform_helpscout_tags

DescriptionUsageParametersExamplesPlacementSource Code

Description
This filter is used to dynamically alter the tags being created for a Help Scout conversation.
Usage
Applies to all forms:
1add_filter( 'gform_helpscout_tags', 'your_function_name', 10, 4 );
Applies to a specific form:
1add_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.

Examples
This example retrieves the license type a user has associated to their user meta and adds it as a tag.
123456789101112add_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;}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
1gf_apply_filters( 'gform_helpscout_tags', $form['id'], $tags, $feed, $entry, $form )
This filter is located in GFHelpScout::process_feed() in class-gf-helpscout.php.

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註