gravityflow_settings_menu_tabs

Description

The gravityflow_settings_menu_tabs filter allows developers to customize the tabs in the Gravity Flow Settings menu.

add_filter('gravityflow_settings_menu_tabs', 'my_custom_function', 10, 1);

Parameters

ParameterTypeDetails
$setting_tabsarrayThe array of settings menu tab definitions.

Examples

Add a Custom Tab to the Settings Menu

add_filter( 'gravityflow_settings_menu_tabs', 'add_custom_settings_tab' );
function add_custom_settings_tab( $setting_tabs ) {
    $setting_tabs[] = array(
        'name'           => 'custom_tab',
        'label'          => __( 'Custom Tab', 'gravityflow' ),
        'callback'       => 'my_custom_tab_callback',
        'icon'           => 'dashicons-admin-generic',
        'icon_namespace' => '',
    );
    return $setting_tabs;
}

function my_custom_tab_callback() {
    echo '<h2>My Custom Tab Content</h2>';
}
Image showing Gravity Flow custom tab in Settings

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?

Source Code

This filter is located in class-gravity-flow.php