gravityflow_step_expiration_timestamp
Use this filter to override the expiration timestamp.
Parameters
Parameter | Type | Definition |
---|---|---|
$expiration_timestamp | integer | The current expiration timestamp (UTC) |
$expiration_type | string | The type of expiration defined in step settings. |
$step | Gravity_Flow_Step | The current entry. |
Examples
This example adjusts expiration by a day based on conditional logic.
add_filter( 'gravityflow_step_expiration_timestamp', 'schedule_business_hours', 10, 3 ); function schedule_business_hours( $expiration_timestamp, $expiration_type, $step ) { //Ensure you are only adjusting the desired form/step if ( $step->get_id() !== 76 ) { return $expiration_timestamp; } $entry = $step->get_entry(); if ( $entry && isset( $entry['2'] ) && $entry['2'] == 'No Service Level Agreement' ) { $expiration_timestamp = strtotime('+1 day', $expiration_timestamp ); } return $expiration_timestamp; }
This example postpones expiration by one day if the expiration day is Saturday/Sunday.
add_filter( 'gravityflow_step_expiration_timestamp', 'sb_exclude_weekend', 10, 3 ); function sb_exclude_weekend( $expiration_timestamp, $expiration_type, $step ) { //Ensure you are only adjusting the desired form/step if ( $step->get_id() !== 492 ) { return $expiration_timestamp; } $dayOfWeek = date('l'); if($dayOfWeek == 'Saturday' || $dayOfWeek == 'Sunday') { $expiration_timestamp = strtotime('+1 day', $expiration_timestamp ); } return $expiration_timestamp; }
Placement
This code should be placed in the functions.php file of your active theme.