Description
Filters the save and continue link, allowing the tag to be customized.
Usage
The following would apply to all forms.
add_filter( 'gform_savecontinue_link', 'your_function_name', 10, 2 );
The following would apply to form ID 3.
add_filter( 'gform_savecontinue_link_3', 'your_function_name', 10, 2 );
Parameters
Examples
Change 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 );
Change the link text
add_filter( 'gform_savecontinue_link', function ( $save_button, $form ) { GFCommon::log_debug( __METHOD__ . '(): Changing Save and Continue link text...' ); $form_id = $form['id']; $button = rgars( $form, 'save/button' ); $button['text'] = 'Your Custom Text 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 );
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in form_display.php.