Using Gravity Forms ‘gform_after_check_update’ PHP filter

The gform_after_check_update is a Gravity Forms action hook that triggers a function once Gravity Forms has checked for an update.

Usage

add_action( 'gform_after_check_update', 'my_custom_function', 10, 0 );
// your custom code here
return my_custom_function;

Parameters

  • This action hook does not take any parameters.

More information

See Gravity Forms Docs: gform_after_check_update
This action hook is located in the update.php file.

Examples

Display a message after an update check

In this example, a simple message “Update was checked” is displayed after Gravity Forms has checked for an update.

function display_update_message() {
    echo 'Update was checked';
}
add_action( 'gform_after_check_update', 'display_update_message', 10, 0 );

Log a message after an update check

This example logs a message to the console after an update check.

function log_update_message() {
    console.log('Update was checked');
}
add_action( 'gform_after_check_update', 'log_update_message', 10, 0 );

Add a timestamp to a log file after an update check

This example adds a timestamp to a log file every time an update check occurs.

function timestamp_update_check() {
    file_put_contents('update_log.txt', date('Y-m-d H:i:s')."\n", FILE_APPEND);
}
add_action( 'gform_after_check_update', 'timestamp_update_check', 10, 0 );

Send an email after an update check

In this example, an email is sent to the admin every time an update check is completed.

function email_on_update_check() {
    wp_mail('[email protected]', 'Gravity Forms Update Check', 'An update check has been performed.');
}
add_action( 'gform_after_check_update', 'email_on_update_check', 10, 0 );

Update a custom database entry after an update check

This example updates a custom database entry each time an update check happens.

function update_db_on_check() {
    global $wpdb;
    $wpdb->update( 'my_table', array( 'last_check' => current_time('mysql') ), array( 'id' => 1 ));
}
add_action( 'gform_after_check_update', 'update_db_on_check', 10, 0 );