Clanbite Since 1.3.0
clanbite_avatar_filter_data( array $data, array $args ): array<string, mixed>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.
Parameters
$data(array<string, mixed>) RequiredResolved avatar data.
$shapestringcircle,squareorhexagon.$show_ringboolWhether the XP ring is drawn.$show_badgeboolWhether the rank badge is drawn.$badgearrayBadge values (static mode only): seeclanbite_get_avatar_badge().
$args(array<string, mixed>) RequiredRender arguments (
type,id,size,context,mode, …).modeisstatic(server-rendered markup) orinteractive(Interactivity API template).
Returns
array<string, mixed> Filtered data.
Defined in inc/avatar-helpers.php
Changelog
| Version | Description |
|---|---|
| 1.3.0 | Introduced. |