Description
The filter allows to modify the message displayed when a checkbox is limited to a maximum number of entries.
Usage
add_filter( 'gform_checkbox_limit_range_message', 'your_function_name', 10, 4 );
Parameters
- $message string
The message to filter. - $min int
The minimum number of choices that must be selected. - $max int
The maximum number of choices that must be selected. - $field integer
The field currently being processed.
Examples
Add a custom message.
add_filter( 'gform_checkbox_limit_range_message', 'range_message', 10, 4 );
function range_message( $message, $min, $max, $field ) {
return 'You have to pick between ' . $min . ' and ' . $max;
}
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 2.9.
Source Code
This filter is located in includes/fields/gf-field-choice.php