gform_post_add_feed

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

ParameterTypeDescription
$feed_idintThe ID of the newly created feed.
$form_idintThe ID of the form to which the feed belongs.
$feed_metaarrayThe feed meta data.
$addon_slugstringThe 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