Description
The gform_post_add_feed action will run after a feed is added to a form.
Usage
add_action( 'gform_post_add_feed', 'your_function_name', 10, 4 );
Parameters
| Parameter | Type | Description |
|---|---|---|
| $feed_id | int | The ID of the newly created feed. |
| $form_id | int | The ID of the form to which the feed belongs. |
| $feed_meta | array | The feed meta data. |
| $addon_slug | string | The slug of the add-on to which the feed belongs. |
Examples
Log when a feed is added
add_action( 'gform_post_add_feed', 'after_add_feed', 10, 4 );
function after_add_feed( $feed_id, $form_id, $feed_meta, $addon_slug ) {
GFCommon::log_debug( __METHOD__ . '(): Feed with id ' . $feed_id . ' added to form with id ' . $form_id . ' by the ' . $addon_slug . ' add-on.' );
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Since
This action was added in Gravity Forms 2.9.20
Source Code
This action is located in includes/api.php