Clanbite Since 1.2.0 Updated in 1.6.3
clanbite_render_avatar_for_interactivity( array $args ): stringRender avatar structure for Interactivity API contexts.
This creates the avatar HTML structure but leaves the src attribute for dynamic binding via data-wp-bind–src. Used by Forums, Social Feed, etc.
Parameters
$args(array) RequiredAvatar rendering arguments.
$typestringAvatar type: 'player', 'team', 'group'. Required.$contextstringContext identifier (e.g., 'forum', 'social_feed'). Required.$sizestringSize preset or slug. Default 'medium'.$shapestringOverride shape. If empty, uses setting.$extra_classesarrayAdditional CSS classes for the avatar container.$img_attributesarrayAdditional attributes for the <img> tag (e.g., data-wp-bind–src).$wrapper_tagstringWrapper element tag. Default 'span'.$wrapper_attrsarrayAdditional attributes for wrapper element.$badge_pathstringInteractivity path of the author'savatar_badgeobject (for examplecontext.item.author.avatar_badge). When set, the avatar gets the shape frame, the XP ring and the rank badge, driven by that object'sdash,level_text,icon_url,labelandhide_*fields (seeclanbite_ranks_get_avatar_badge_for_rest()).$show_rank_iconsboolLegacy: include the rank icon stack template. Default false.$rank_icons_pathstringdata-wp-each path for rank icons.$rank_icons_hidestringdata-wp-bind–hidden for rank icons.$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 with Interactivity API directives.
Defined in inc/avatar-helpers.php
Changelog
| Version | Description |
|---|---|
| 1.6.3 | Updated. |
| 1.3.0 | Updated. |
| 1.2.0 | Introduced. |