Description
The “gform_slack_invite” filter in the Gravity Forms Slack Add-On allows the invite user parameters to be modified before the invite is sent to Slack. The Invite User option in the Feed Setup only appears if setup is done by an admin user.
Usage
The following would apply to all forms:
add_filter( 'gform_slack_invite', 'your_function_name', 10, 4 );
To target a specific form, append the form id to the hook name. (format: gform_slack_invite_FORMID)
add_filter( 'gform_slack_invite_1', 'your_function_name', 10, 4 );
Parameters
- $invite array
Invite parameters.
-
$feed Feed Object
The current feed object.
-
$entry Entry Object
The current entry object.
-
$form Form Object
The current form object.
Examples
add_filter( 'gform_slack_invite', 'change_invite', 10, 4 ); function change_invite( $invite, $feed, $entry, $form ){ $invite['team'] = 'rocketgenius'; return $invite; }
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in version 1.6.
Source Code
This filter is located in GFSlack::send_invite() in gravityformsslack/class-gf-slack.php.