gform_pre_delete_feed

Description

The gform_pre_delete_feed hook can be used to perform a custom action just before a feed is deleted from the database.

Usage

The hook which would run for all add-ons would be used like so:

add_action( 'gform_pre_delete_feed', 'your_function_name', 10, 2 );

You can target a specific add-on with the following variation of this hook:

add_action( 'gform_{SHORT_SLUG}_pre_delete_feed', 'your_function_name', 10, 2 );

See the Gravity Forms Add-On Slugs article for a list of possible short slugs.

Parameters

Examples

1. Get feed before it is deleted

add_action( 'gform_pre_delete_feed', 'pre_delete_feed', 10, 2 );
function pre_delete_feed( $id, $addon ) {
    $feed = $addon->get_feed( $id );
    // Do something with the $feed.
}

Source Code

This action hook is located in GFFeedAddOn::delete_feed() in /includes/addons/class-gf-feed-addon.php.

Since

This hook was added in Gravity Forms 2.4.20.4