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
| Parameter | Type | Description |
|---|---|---|
| $id | int | The ID of the feed being updated. |
| $is_active | bool | The new active status of the feed (true = active, false = inactive). |
| $this | GFFeedAddOn | The 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