Description
Allows the default Image Choice label visibility setting to be managed.
Usage
Applies to all forms:
add_filter( 'gform_image_choice_label_visibility_default', 'your_function_name', 10, 1 );
Applies to a specific form:
add_filter( 'gform_image_choice_label_visibility_default_FORMID', 'your_function_name', 10, 1 );
Parameters
- $label_visibility_default string
Default is show.
Examples
Updates the choice label visibility, setting the default to hide the labels. It will also hide the inputs for any form where a new Image Choice field is added.
add_filter( 'gform_image_choice_label_visibility_default', function( $label_visibility_default) {
return 'hide';
}, 10, 1 );
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/class-gf-field-image-choice.php