Clanbite Social Kit Since 1.6.2

picker( array $args ): string

The reaction picker popover: one button per reaction type.

public static

Class: Kernowdev\ClanbiteSocialKit\Social\Reaction_Markup

Parameters

$args (array<string, mixed>) Required

Picker arguments.

  • $prefix string BEM block, e.g. clanbite-social-feed or clanbite-forums-board. Required.
  • $surface string Where it is shown (feed, forums…): added as the class is-{surface} so each surface can be styled on its own.
  • $action string Store action run on click, e.g. actions.toggleReaction. Required.
  • $hidden string Binding that hides the popover, e.g. state.isPostReactionPickerHidden. Required.
  • $active string Callback that marks the viewer's current reaction, e.g. callbacks.isReactionActive.
  • $bind array<string, string> Extra attribute => binding pairs on each button (the object ID the action needs).
  • $popover_attrs array<string, string> Extra attributes on the popover (an ID binding for aria-controls).
  • $button_class string Extra classes on each button (wp-element-button clanbite-button…).
  • $types array<int, array> Reaction definitions (slug, label, …). Default: the shared registry.

Returns

string HTML (already escaped).

Defined in inc/Social/Reaction_Markup.php

Changelog

VersionDescription
1.6.2Introduced.