Description
The gravityflowformconnector_form_submission_invalid_link_message filter allows developers to customize the validation message shown when a Form Submission step link is no longer valid, for example because it expired, was already used, or the step is no longer accepting submissions.
The default message is: This link is no longer valid. It may have expired or already been used.
Usage
The following would apply to all forms.
add_filter( 'gravityflowformconnector_form_submission_invalid_link_message', 'your_function_name', 10, 2 );
Parameters
| Parameter | Type | Description |
|---|---|---|
| $message | string | The validation message. It is displayed as plain text; HTML is escaped. |
| $form | Form Object | The target form being validated. |
Examples
Change the message for a specific form.
// Show a custom message when the Form Submission link for form 5 is no longer valid.
add_filter( 'gravityflowformconnector_form_submission_invalid_link_message', 'my_invalid_link_message', 10, 2 );
function my_invalid_link_message( $message, $form ) {
if ( (int) rgar( $form, 'id' ) !== 5 ) {
return $message;
}
return 'This link has expired. Please contact the HR team at [email protected] for a new one.';
}
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?
Source Code
This filter is located in gravityflowformconnector/class-form-connector.php.
Since
This filter was added in Gravity Flow Form Connector 2.9.0.