Clanbite Since 1.2.0 Updated in 1.6.3
clanbite_render_avatar( array $args ): stringRender a complete avatar with all wrappers, shape classes, and optional overlays.
This is the main function that should be used for ALL avatar rendering across the plugin and extensions. It provides a consistent structure and filter points.
Parameters
$args(array) RequiredAvatar rendering arguments.
$typestringAvatar type: 'player', 'team', 'group'. Required.$idintEntity ID (user_id, team_id, or group_id). Required.$sizestringSize preset: 'large', 'medium', 'small', or custom size slug.$contextstringContext identifier for filtering (e.g., 'profile', 'social_feed', 'forums').$shapestringOverride shape: 'circle', 'square', 'hexagon'. If empty, uses setting.$linkboolWhether to wrap in a profile link. Default false.$link_targetstringLink target attribute. Default empty.$extra_classesarrayAdditional CSS classes for the avatar container.$show_rankbool|nullShow the rank badge (level icon or number). Default null: automatic, shown when the Ranks settings enable it for this avatar's player. False forces it off.$show_progressbool|nullShow the XP ring around the avatar. Default null: automatic, shown when a Ranks ladder has "Show progress on avatar" enabled. False forces it off.$viewer_idintWho is looking at the avatar. Default: the current user (0 for guests).$object_typestringWhat the avatar is shown in, e.g. 'post', 'reply', 'notification', 'activity', 'topic', 'card'.$object_idintID of that object (post, reply, notification…), 0 when there is none.$extensionstringSlug of the extension that renders it (e.g. 'cp_social_kit'), so filters can target a plugin.$context_dataarrayAny extra facts a filter may need (forum ID, team ID, feed type…). Never printed.
Returns
string HTML markup.
Defined in inc/avatar-helpers.php
Changelog
| Version | Description |
|---|---|
| 1.6.3 | Updated. |
| 1.3.0 | Updated. |
| 1.2.0 | Introduced. |