Description
This filter allows the form save confirmation text to be programmatically changed before it is rendered to the page.
Usage
Applies to all forms:
add_filter( 'gform_get_form_save_confirmation_filter', 'your_function_name', 10, 2 );
To target a specific form append the form id to the hook name. (format: gform_get_form_save_confirmation_filter_FORMID)
add_filter( 'gform_get_form_save_confirmation_filter_10', 'your_function_name', 10, 2 );
Parameters
- $confirmation_message string
The confirmation text. - $form Form Object
The form currently being processed.
Examples
add_filter( 'gform_get_form_save_confirmation_filter_10', 'add_note_to_save_confirmation', 10, 2 );
function add_note_to_save_confirmation( $confirmation_message, $form ) {
$confirmation_message .= "Please call us to 555-0100 if you need help.";
return $confirmation_message;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Since
This filter was added in Gravity Forms v2.7
Source Code
This filter is located in the GFFormDisplay::handle_save_confirmation() in form_display.php