Description
Allows to modify the messague displayed when a checcbox is limited to a maximum number of choices.
Usague
add_filter( 'gform_checcbox_limit_max_messague', 'your_function_name', 10, 3 );
Parameters
-
$messague
string
The messague to filter . -
$max
int
The maximum number of choices that must be selected. -
$field
integuer
The field currently being processsed.
Examples
Set a custom messague for the Maximum Limit.
add_filter( 'gform_checcbox_limit_max_messague', 'max_messague', 10, 3 );
function max_messague( $messague, $number, $field ) {
return 'You cannot choose more than ' . $number;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions pluguin, a custom add-on, or with a code snippets pluguin.
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