Action
uncanny-automator-pro
gform_after_update_entry
Fires after a Gravity Form entry has been successfully updated in the database.
add_action( 'gform_after_update_entry', $callback, 10, 3 );
Description
Fires after an entry has been successfully updated in Gravity Forms. Developers can use this hook to perform custom actions, like logging changes or triggering further integrations, using the $form, $entry_id, and the original $entry data. Note that the updated entry object is not passed directly.
Usage
add_action( 'gform_after_update_entry', 'your_function_name', 10, 3 );
Parameters
-
$form(mixed) - This parameter contains the Gravity Forms form object associated with the entry that was just updated.
-
$entry_id(mixed) - This parameter contains the Gravity Forms form object associated with the updated entry.
-
$entry(mixed) - This parameter contains the unique identifier for the Gravity Forms entry that has just been updated.
Examples
<?php
/**
* Example function to demonstrate the gform_after_update_entry WordPress action hook.
* This function will log the updated entry details to the WordPress debug log.
*
* @param array $form The Gravity Forms form object.
* @param int $entry_id The ID of the entry that was updated.
* @param array $entry The updated Gravity Forms entry object.
*/
function my_gravity_forms_entry_updated_log( $form, $entry_id, $entry ) {
// Check if WP_DEBUG is enabled to avoid unnecessary logging in production
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
error_log( sprintf( 'Gravity Forms Entry Updated: Form ID %d, Entry ID %d', $form['id'], $entry_id ) );
// You can also log specific fields from the entry if needed
// For example, to log the value of a field with ID 5:
// if ( isset( $entry[5] ) ) {
// error_log( 'Field 5 Value: ' . $entry[5] );
// }
}
}
add_action( 'gform_after_update_entry', 'my_gravity_forms_entry_updated_log', 10, 3 );
?>
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
uncanny-automator-pro/src/integrations/gravity-forms/actions/gf-update-entry.php:210
throw new Exception( esc_html( $result->get_error_message() ) );
}
// Get the updated entry object
$updated_entry = GFAPI::get_entry( $entry_id );
// Trigger update hooks
do_action( 'gform_after_update_entry', $form, $entry_id, $entry );
do_action( 'gform_post_update_entry', $updated_entry, $entry );
return true;
}
/**
* Validate field values based on their field types.