> For the complete documentation index, see [llms.txt](https://ctracker-docs.keywordrush.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ctracker-docs.keywordrush.com/for-developers/member-area-hooks.md).

# Adding your own content to the member area

Cashback rules under the history table. A link to your terms in the rail. A payout notice above the form. None of these need a template override — the member area has a slot for each of them.

### The slots

Every action below is passed the member's user id.

| Hook                             | Fires                                                   |
| -------------------------------- | ------------------------------------------------------- |
| `cbtrkr_account_before`          | Before everything, outside the account                  |
| `cbtrkr_account_rail_before_nav` | In the rail, under the balance card                     |
| `cbtrkr_account_rail_after_nav`  | In the rail, under the navigation                       |
| `cbtrkr_account_tab_top`         | At the top of **every** tab. Also passed the tab's slug |
| `cbtrkr_account_tab_bottom`      | At the bottom of every tab. Also passed the slug        |
| `cbtrkr_account_{tab}_top`       | At the top of **one** tab                               |
| `cbtrkr_account_{tab}_bottom`    | At the bottom of one tab                                |
| `cbtrkr_account_after`           | After everything                                        |

The tab slugs are `dashboard`, `history`, `payouts` and `referrals`, giving names like `cbtrkr_account_history_bottom` and `cbtrkr_account_payouts_top`.

### Cashback rules under the history

```php
add_action('cbtrkr_account_history_bottom', function () {
    echo '<div class="cbtrkr_account_empty">';
    echo '<div class="cbtrkr_account_empty_title">Why is my cashback still pending?</div>';
    echo '<div class="cbtrkr_account_empty_text">Shops confirm orders on their own schedule — usually 30 to 60 days, and longer for travel. We pay it out as soon as they do.</div>';
    echo '</div>';
});
```

Writing this yourself is the right way round. The plugin will not print an approval time next to a member's own order, because the only number it could use is an average across every order that shop has ever reported, and beside one order that reads as a promise. In your own words, on your own page, it is a helpful generalisation.

### Payout rules above the form

```php
add_action('cbtrkr_account_payouts_top', function () {
    echo '<div class="cbtrkr_account_notice">Payouts are sent on the first working day of each month. Requests made after the 25th are included in the following run.</div>';
});
```

### A terms link in the rail

```php
add_action('cbtrkr_account_rail_after_nav', function () {
    echo '<a class="cbtrkr_account_link" href="' . esc_url(get_permalink(42)) . '">Cashback terms</a>';
});
```

The rail is a vertical stack, so anything you add there wants to be narrow. On a phone the rail becomes a band across the top and your block travels with it.

### One notice on every tab

```php
add_action('cbtrkr_account_tab_top', function ($tab, $user_id) {
    if (get_user_meta($user_id, '_needs_tax_form', true))
        echo '<div class="cbtrkr_account_notice">We need a tax form from you before your next payout.</div>';
}, 10, 2);
```

Note the `10, 2` — the generic pair is passed the slug first and the member second, so a callback that wants the user id must accept both.

### Extra detail on an activity row

`cbtrkr_account_row_meta` filters the middle line of one row. It receives an array of strings, which the row joins with `·`, and the row's full data.

```php
add_filter('cbtrkr_account_row_meta', function ($meta, $entry) {
    if ($entry['type'] === 'cashback' && $entry['status_key'] === 'declined')
        $meta[] = 'returns and cancellations are not eligible';

    return $meta;
}, 10, 2);
```

The keys on `$entry` are `id`, `type`, `date_ts`, `description`, `shop` (an array of `name`, `logo`, `url`, or `null`), `order_ref`, `sale_amount_display`, `available_ts`, `status_key`, `status_label`, `amount`, `amount_display`, `is_negative` and `is_void`.

### A tab of your own

Register it, then render it:

```php
add_filter('cbtrkr_account_tabs', function ($tabs) {
    $tabs['vouchers'] = 'My vouchers';
    return $tabs;
});

add_filter('cbtrkr_account_tab_content', function ($body, $active, $user_id) {
    return $active === 'vouchers' ? my_render_vouchers($user_id) : $body;
}, 10, 3);
```

Your tab gets `cbtrkr_account_vouchers_top` and `cbtrkr_account_vouchers_bottom` for free — the dynamic names are built from whichever tab is being shown.

{% hint style="warning" %}
Return the `$body` you were given whenever the active tab is not yours. Returning your own content unconditionally blanks every other tab on the site.
{% endhint %}

### Reusing the plugin's styling

Your blocks will look like the rest of the account if you borrow its classes:

| Class                                             | Renders as                                                     |
| ------------------------------------------------- | -------------------------------------------------------------- |
| `cbtrkr_account_card`                             | A white card with the standard border and radius               |
| `cbtrkr_account_notice`                           | A tinted strip with an accent edge                             |
| `cbtrkr_account_empty`                            | A tinted panel — the empty-state look, useful for explanations |
| `cbtrkr_account_empty_title` / `_text`            | Its heading and body                                           |
| `cbtrkr_account_sec` + `cbtrkr_account_sec_title` | A section heading matching *Recent activity*                   |
| `cbtrkr_account_button`                           | The primary button                                             |
| `cbtrkr_account_link`                             | An accent-coloured text link                                   |
| `cbtrkr_account_rules`                            | A tidy bullet list                                             |

All of them read the same [design tokens](/putting-it-on-your-pages/colors-and-css.md) as the rest of the plugin, so they follow your accent colour without any work.

### Escaping

These are actions that echo, so nothing escapes for you. Run anything from the database or from a member through `esc_html()`, and anything going into an attribute through `esc_attr()` or `esc_url()`.

### Related

* [Events and hooks](/for-developers/events-and-hooks.md)
* [Template reference](/for-developers/template-reference.md)
* [Colours and CSS](/putting-it-on-your-pages/colors-and-css.md)
* [What members see](/members-and-payouts/what-members-see.md)
