gform_checkbox_select_all_label

gform_checkbox_select_all_label

DescriptionUsageParametersExamples1. All forms2. Specific form3. Specific checkbox field on a formPlacementSinceSource Code

Description
The 「gform_checkbox_select_all_label」 filter in Gravity Forms allows the 「Select All」 label for the Checkboxes field to be modified.
Usage
The following would apply to all forms:
1add_filter( 'gform_checkbox_select_all_label', 'your_function_name', 10, 2 );
To target a specific form, append the form id to the hook name. (format: gform_checkbox_select_all_label_FORMID)
1add_filter( 'gform_checkbox_select_all_label_1', 'your_function_name', 10, 2 );
To target a specific field for a form, append the form id and field id to the hook name. (format: gform_checkbox_select_all_label_FORMID_FIELDID)
1add_filter( 'gform_checkbox_select_all_label_1_22', 'your_function_name', 10, 2 );

Parameters

$select_label string
The 「Select All」 label.

$field Field Object
The field object for the current field.

Examples
1. All forms
1234add_filter( 'gform_checkbox_select_all_label', 'change_label', 10, 2 );function change_label( $select_label, $field ){    return "My Custom Select All";}
2. Specific form
1234add_filter( 'gform_checkbox_select_all_label_114', 'change_label', 10, 2 );function change_label( $select_label, $field ){    return "My Custom Select All";}
3. Specific checkbox field on a form
1234add_filter( 'gform_checkbox_select_all_label_114_2', 'change_label', 10, 2 );function change_label( $select_label, $field ){    return "My Custom Select All";}
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms version 2.3.
Source Code
This filter is located in GF_Field_Checkbox::get_checkbox_choices() in gravityforms/fields/includes/class-gf-field-checkbox.php.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注