Description
The gform_field_settings_tabs filter enables new tabs to be registered for display in the field settings panel in the form editor. Use the gform_field_settings_tab_content action hook to echo the tab content.
Note: the filter can only be used to add new tabs and there is no provision to remove tabs.
Usage
The filter which would run for all forms would be used like so:
add_filter( 'gform_field_settings_tabs', 'your_function_name', 10, 2 );
You can also target a specific form by adding the form id after the hook name.
add_filter( 'gform_field_settings_tabs_6', 'your_function_name', 10, 2 );
Parameters
- $tabs array
An array of custom field settings tabs. - $form Form Object
The form currently being edited.
Examples
1. Add a new tab
add_filter('gform_field_settings_tabs', function($tabs, $form) {
// Add a custom tab
$tabs[] = array(
'id' => 'my_custom_tab_1', // The Tab ID
'title' => 'My Custom Tab', // The Tab Title
'toggle_classes' => array('my_toggle_class_1', 'my_toggle_class_2'),
'body_classes' => array('my_body_class_1'),
);
return $tabs;
}, 10, 2);
Placement
This code should be placed in the functions.php file of your active theme or a custom functions plugin.
Since
This filter was added in Gravity Forms v2.5.
Source Code
This filter is located in GFFormDetail::forms_page() in form_detail.php