gform_entry_ids_automatic_deletion

gform_entry_ids_automatic_deletion

DescriptionUsageParametersExamplesPlacementSinceSource Code

Description
Allows the array of entry IDs to be modified before automatically deleting entries according to the personal data retention policy.
Usage
add_filter( 'gform_entry_ids_automatic_deletion', 'your_function_name', 10, 1 );

Parameters

$entry_ids array
The array of entry IDs to delete.

Examples
add_filter( 'gform_entry_ids_automatic_deletion', 'save_entries', 10, 1 );
function save_entries( $entry_ids ){
$delete_ids = array();
foreach ( $entry_ids as $entry_id )
{
$entry = GFFormsModel::get_entry( $entry_id );
//save entries for form id 74 that are not in the trash
if ( ! $entry['form_id'] == 74 || $entry['status'] == 'trash' ){
$delete_ids[] = $entry_id;
GFCommon::log_debug( 'Deleting entry ' . $entry['id'] );
}
else{
GFCommon::log_debug( 'Not deleting entry ' . $entry['id'] );
}
}
return $delete_ids;
}

Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms version 2.4.
Source Code
This filter is located in GF_Personal_Data::cron_task() in includes/class-personal-data.php.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注