# clanbite_avatar_filter_data()

Filter the resolved avatar data before any markup is built.

This is the one place to change what an avatar *is* (its shape, whether the XP ring or rank badge shows, the badge
values), independent of where it is rendered and whether the markup is built on the server or by the Interactivity API.
Both `clanbite_render_avatar()` and `clanbite_render_avatar_for_interactivity()` call it, so a context-only rule such as
"forum avatars are squares without a ring" works for every surface that renders that context.

```php
clanbite_avatar_filter_data( array $data, array $args ): array
```

## Parameters

- `$data` (array<string, mixed>) Resolved avatar data.
  - `$shape` (string) `circle`, `square` or `hexagon`.
  - `$show_ring` (bool) Whether the XP ring is drawn.
  - `$show_badge` (bool) Whether the rank badge is drawn.
  - `$badge` (array) Badge values (static mode only): see `clanbite_get_avatar_badge()`.
- `$args` (array<string, mixed>) Render arguments (`type`, `id`, `size`, `context`, `mode`, …). `mode` is `static` (server-rendered markup) or `interactive` (Interactivity API template).

## Return

`array<string, mixed>` Filtered data.

## Changelog

| Version | Description |
| --- | --- |
| 1.3.0 | Introduced |
