Clanbite Since 1.3.0

clanbite_avatar_badge_html( string $shape, array $badge, string $bind = '' ): string

The rank badge: a small shape (hexagon for hexagon avatars) at the avatar's lower right, holding the level icon or number.

Server rendering takes the data from $badge; Interactivity rendering passes $bind (a path to an avatar_badge object) and the browser fills in the icon, number and label.

Parameters

$shape (string) Required

circle, square or hexagon.

$badge (array<string, mixed>) Required

Data from clanbite_get_avatar_badge() (ignored when $bind is set).

$bind (string) Optional

Interactivity path of the avatar_badge object, or empty for server rendering.

Default: ''

Returns

string Badge markup, or an empty string when there is nothing to show.

Defined in inc/avatar-helpers.php

Changelog

VersionDescription
1.3.0Introduced.