DescriptionUsageParametersExamples1. Get feed before it is deletedSource CodeSince
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:
1add_action( 'gform_pre_delete_feed', 'your_function_name', 10, 2 );
You can target a specific add-on with the following variation of this hook:
1add_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
$id int
The ID of the feed being deleted.
$addon object
The current instance of the add-on object which extends GFFeedAddOn or GFPaymentAddOn (i.e. GFCoupons, GF_User_Registration, GFStripe).
Examples
1. Get feed before it is deleted
12345add_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