gform_update_feed_active

Description

The gform_update_feed_active action fires immediately after a feed’s active status is updated.

Usage

add_action( 'gform_update_feed_active', 'your_function_name', 10, 3 );

Parameters

ParameterTypeDescription
$idintThe ID of the feed being updated.
$is_activeboolThe new active status of the feed (true = active, false = inactive).
$thisGFFeedAddOnThe current instance of the add-on performing the update. In callbacks, this will be passed as the $addon argument.

Examples

Log feed activation changes

add_action( 'gform_update_feed_active', 'test_update_feed_active', 10, 3 );
function test_update_feed_active( $feed_id, $status, $addon ) {
    GFCommon::log_debug( __METHOD__ . '(): Feed with id ' . $feed_id . ' changed to status ' . ( $status ? 'active' : 'inactive' ) . ' 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?

Source Code

This action is located in includes/addon/class-gf-feed-addon.php

Since

This action was added in Gravity Forms 2.9.20