Clanbite Social Kit Since 1.6.2
ui_state( array $def, int $object_id, array $counts, array $user_slugs, ?array $reactor_ids = null ): array{reactions_display: array<int, array<string, mixed>>, my_reaction: array<string, mixed>, liked: bool, viewer_can_react: bool}Everything the reaction UI shows for one object: the chips with counts and reactors, the viewer's own reaction and flags.
Returned by Reactions::toggle() and used by every surface that lists objects, so a feed card and a forum post render the same data from the same builder.
public static
Class: Kernowdev\ClanbiteSocialKit\Social\Reactions
Parameters
$def(array<string, mixed>) RequiredObject type definition.
$object_id(int) RequiredObject ID.
$counts(array<string, int>) RequiredCounts by reaction slug.
$user_slugs(string[]) RequiredReactions the viewer has on the object.
$reactor_ids(array<string, int[]>) OptionalOptional preloaded reactor IDs per slug (otherwise asked from the object type).
Default:
null
Returns
array{reactions_display: array<int, array<string, mixed>>, my_reaction: array<string, mixed>, liked: bool, viewer_can_react: bool}
Defined in inc/Social/Reactions.php
Changelog
| Version | Description |
|---|---|
| 1.6.2 | Introduced. |