Description
The gform_uninstalling
action hook can be used to perform any clean-up tasks when the uninstall button has been clicked on the Forms > Settings > Uninstall page.
Usage
The action hook which runs during uninstall would be used like so:
add_action( 'gform_uninstalling', 'your_function_name' );
Parameters
This hook has no parameters.
Examples
Delete an option on uninstall
This example shows how you can delete custom options from the wp_options table when Gravity Forms is uninstalled.
add_action( 'gform_uninstalling', function() {
delete_option( 'your_option_name );
} );
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 hook was added in Gravity Forms v2.6.9.
Source Code
This action hook is located in GFSettings::settings_uninstall_page()
in settings.php.