gform_save_and_continue_resume_url

Description

Use this filter to change the resume link generated when an incomplete submission is saved.

Usage

add_filter( 'gform_save_and_continue_resume_url', 'your_function_name', 10, 4 );

Parameters

  • $resume_url string
    The current resume url.
  • $form Form Object
    The form that is currently being processed.
  • $token string
    The unique token generated when the incomplete submission was saved.
  • $email string
    The email the resume link will be sent to.

Examples

1. Override the resume url

This example shows how you can change the resume url.

add_filter( 'gform_save_and_continue_resume_url', function( $resume_url, $form, $token, $email ) {
    return str_replace( 'http:', 'https:', $resume_url );
}, 10, 4 );

2. Remove query arguments from url

add_filter( 'gform_save_and_continue_resume_url', function( $resume_url, $form, $token, $email ) {
    // remove specific query arg
    //$resume_url = remove_query_arg( array( 'boom' ), $resume_url );
 
    // remove ALL query args
    $resume_url = add_query_arg( array( 'gf_token' => $token ), array_shift( explode( '?', $resume_url ) ) );
 
    return $resume_url;
}, 10, 4 );

3. Require login

add_filter( 'gform_save_and_continue_resume_url', function( $resume_url ) {
    return wp_login_url( $resume_url );
} );

Placement

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

Source Code

This filter is located in GFFormDisplay::replace_save_variables() in form_display.php.