Using Gravity Forms ‘gform_savecontinue_link’ PHP action

The gform_savecontinue_link Gravity Forms PHP filter allows you to customize the save and continue link.

Usage

To apply the filter to all forms:

add_filter( 'gform_savecontinue_link', 'your_function_name', 10, 2 );

To apply the filter to a specific form (e.g., form ID 3):

add_filter( 'gform_savecontinue_link_3', 'your_function_name', 10, 2 );

Parameters

  • $save_button (string): The string containing the save and continue link markup.
  • $form (array): The Form object associated with the link.

More information

See Gravity Forms Docs: gform_savecontinue_link

Examples

Change to an image button

This example changes the save and continue button to an image button.

add_filter( 'gform_savecontinue_link', function( $save_button, $form ) {
    $form_id = $form['id'];
    $button = rgars( $form, 'save/button' );
    $button['type'] = 'image';
    $button['imageUrl'] = 'the/url/here';

    return rgars( $form, 'save/enabled' ) ? GFFormDisplay::get_form_button( $form_id, "gform_save_{$form_id}_link", $button, rgar( $button, 'text' ), 'gform_save_link', rgar( $button, 'text' ), 0, "jQuery(\"#gform_save_{$form_id}\").val(1);" ) : $save_button;
}, 10, 2 );

Place this code in the functions.php file of your active theme.