Description
The wsf_field_invalid_feedback_text filter allows you to the change the default invalid feedback text shown on a field if it is not validated.
The default string is: This field is required.
You can use the following WS Form variables in this string:
Variable | Description |
---|---|
#label |
The field label. |
#label_lowercase |
The field label lowercase. |
Usage
add_filter( 'wsf_field_invalid_feedback_text', 'my_hook_function', 10, 1 );
Parameters
$invalid_feedback_text
StringThe invalid feedback text shown if a field is not validated.Default value:"This field is required."
Example
// Callback function for the wsf_field_invalid_feedback_text filter hook function my_hook_function( $invalid_feedback_text ) { // Your code here ... // Return value return "Please enter a valid #label_lowercase"; } // Add a callback function for the wsf_field_invalid_feedback_text filter hook add_filter( 'wsf_field_invalid_feedback_text', 'my_hook_function', 10, 1 );
Source File
This hook can be found in:<plugin root>/includes/class-ws-form-config.php