Documentation » Filter Hooks

groundhogg/admin/settings/tabs

Published · Last updated

Filters the tabs displayed on the Groundhogg settings page. Use this to add a custom settings tab for your extension.

apply_filters( 'groundhogg/admin/settings/tabs', $tabs );

You will receive the current array of tab definitions.

Example

add_filter( 'groundhogg/admin/settings/tabs', 'my_extension_add_settings_tab' );

/**
 * Add a settings tab for My Extension.
 *
 * @param array $tabs
 *
 * @return array
 */
function my_extension_add_settings_tab( $tabs ) {
    $tabs['my_extension'] = [
        'title' => 'My Extension',
        'id'    => 'my_extension',
    ];

    return $tabs;
}