Description
The “gform_visibility_options” filter in Gravity Forms allows default visibility options to be modified or removed and custom visibility options to be added.
Usage
add_filter( 'gform_visibility_options', 'my_function', 10 );
Parameters
- $options array
An array of visibility options.
Examples
add_filter( 'gform_visibility_options', 'my_custom_visibility_options' ); function my_custom_visibility_options( $options ) { $options[] = array( 'label' => __( 'Custom Option' ), 'value' => 'custom', 'description' => __( 'This is a description of my custom visibility option. It will show up in the Visibility setting tooltip.' ) ); return $options; }
Source Code
return (array) apply_filters( 'gform_visibility_options', $options );
This hook is located in GFCommon::get_visibility_options() in common.php