gform_post_upgrade

Description

The “gform_post_upgrade” action hook in Gravity Forms fires after Gravity Forms has been fully upgraded, allowing further actions to be performed.

Usage

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

Parameters

  • $version string

    The upgraded version of Gravity Forms.

  • $from_db_version string

    The version before the upgrade.

  • $force_upgrade bool

    True/false indicating if the upgrade were forced.

Examples

add_action( 'gform_post_upgrade', 'alert_upgrade', 10, 3 );
function alert_upgrade( $version, $from_db_version, $force_upgrade ){
   echo 'Gravity Forms was upgraded from ' . $from_db_version . ' to ' . $version;
}

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This filter is located in GFUpgrade::set_upgrade_ended() in class-gf-upgrade.php.