groundhogg/admin/contact/record/tabs

πŸ“… Published on

πŸ“ Last updated

Documentation

Β»

Filter Hooks

Β»

groundhogg/admin/contact/record/tabs

Filters the tabs displayed on the contact record edit screen. Use this to add custom tabs to the contact editor.

apply_filters( 'groundhogg/admin/contact/record/tabs', $tabs, $contact );

You will receive the current tabs array and the Contact object.

Example

add_filter( 'groundhogg/admin/contact/record/tabs', 'my_extension_add_record_tab', 10, 2 );

/**
 * Add a custom "Orders" tab to the contact record.
 *
 * @param array                $tabs
 * @param \Groundhogg\Contact $contact
 *
 * @return array
 */
function my_extension_add_record_tab( $tabs, $contact ) {
    $tabs['my_extension_orders'] = [
        'title' => 'Orders',
        'slug'  => 'my_extension_orders',
    ];

    return $tabs;
}

Was this helpful?

Let us know if this document answered your question. That’s the only way we can improve.