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>) Required

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>) Required

Render arguments (type, id, size, context, mode, …). mode is static (server-rendered markup) or interactive (Interactivity API template).

Returns

array<string, mixed> Filtered data.

Defined in inc/avatar-helpers.php

Changelog

VersionDescription
1.3.0Introduced.