Classes 3
Componentsclanbite-social-kitRegisters reactions and @mentions as components, so Forums and other extensions ask the registry for them (clanbite_has_component( 'reactions' ), clanbite_render_component( 'reaction-summary', … )) instead of calling Social Kit's functions directly. A site without Social Kit simply has none of these components.Reaction_Markupclanbite-social-kitThe one place the reaction chips and the reaction picker are written.Reactionsclanbite-social-kitReactions for anything, owned by Social Kit.
Components 4
mentionsclanbite-social-kitTurns @username into profile links (respecting each member's privacy setting) and loads the @ picker for editors.reaction-pickerclanbite-social-kitThe popover of reactions a member can choose from.reaction-summaryclanbite-social-kitThe reaction chips of one object, each with a tooltip of who reacted.reactionsclanbite-social-kitReactions for any registered object type: the toggle API, the REST route and the browser client.
Functions 11
clanbite_notification_actor_avatar_html()clanbiteThe actor's avatar as the shared Clanbite avatar (shape, XP ring and rank badge), so notifications match the rest of the site.clanbite_social_kit_enqueue_reactions()clanbite-social-kitLoad the shared reactions client script (window.clanbite.reactions) on a page that shows reactions.clanbite_social_kit_enqueue_reactions()clanbite-social-kitLoad the shared reactions client script; global alias of \Kernowdev\ClanbiteSocialKit\clanbite_social_kit_enqueue_reactions().clanbite_social_kit_register_reactable()clanbite-social-kitMake an object type reactable (see \Kernowdev\ClanbiteSocialKit\Social\Reactions for the arguments).clanbite_social_kit_register_reactable()clanbite-social-kitMake an object type reactable; global alias of \Kernowdev\ClanbiteSocialKit\clanbite_social_kit_register_reactable().clanbite_social_kit_render_reaction_picker()clanbite-social-kitMarkup for the reaction picker; see \Kernowdev\ClanbiteSocialKit\Social\Reaction_Markup::picker().clanbite_social_kit_render_reaction_picker()clanbite-social-kitMarkup for the reaction picker; global alias of \Kernowdev\ClanbiteSocialKit\clanbite_social_kit_render_reaction_picker().clanbite_social_kit_render_reaction_summary()clanbite-social-kitMarkup for the reaction chips (with tooltips) of one object; see \Kernowdev\ClanbiteSocialKit\Social\Reaction_Markup::summary().clanbite_social_kit_render_reaction_summary()clanbite-social-kitMarkup for the reaction chips of one object; global alias of \Kernowdev\ClanbiteSocialKit\clanbite_social_kit_render_reaction_summary().clanbite_social_kit_toggle_reaction()clanbite-social-kitToggle a reaction on any registered object type, with every check and shared hook applied.clanbite_social_kit_toggle_reaction()clanbite-social-kitToggle a reaction on any registered object type; global alias of \Kernowdev\ClanbiteSocialKit\clanbite_social_kit_toggle_reaction().
Hooks 12
clanbite_social_kit_can_reactclanbite-social-kitFilters whether a user may apply a reaction to an object. The single permission hook for every surface.clanbite_social_kit_comment_deletedclanbite-social-kitFires after a social comment and the replies below it were deleted.clanbite_social_kit_comment_updatedclanbite-social-kitFires after a social comment was edited.clanbite_social_kit_object_reaction_toggledclanbite-social-kitFires after a reaction is toggled on any object, whichever extension owns it.clanbite_social_kit_reaction_picker_htmlclanbite-social-kitFilters the reaction picker markup before it is printed.clanbite_social_kit_reaction_summary_htmlclanbite-social-kitFilters the reaction chips markup before it is printed.clanbite_social_kit_register_reactablesclanbite-social-kitFires once when reactable object types are collected: call clanbite_social_kit_register_reactable() here.clanbite_social_kit_user_can_delete_commentclanbite-social-kitFilters whether a user may delete a social comment.clanbite_social_kit_user_can_edit_commentclanbite-social-kitFilters whether a user may edit a social comment.clanbite.popup.toggledclanbite-social-kitThis action is documented in assets/js/clanbite-popups.js (clanbite.popup.toggled).clanbite.reactions.requestclanbite-social-kitFilters the request before a reaction toggle is sent.clanbite.reactions.toggledclanbite-social-kitFires after the server answered a reaction toggle.
Messages 2
feed_toast.reply_delete_failedclanbite-social-kitfeed_toast.reply_update_failedclanbite-social-kit
Methods 27
Components::register_components()clanbite-social-kitRegister the components.Components::register()clanbite-social-kitHook the registration (needs Clanbite 1.6.4+; older core ignores it).Data_Access::delete_comment_tree()clanbite-social-kitDelete a comment with its replies and their reactions.Data_Access::update_comment_content()clanbite-social-kitReplace a comment's content.Data_Access::user_can_delete_comment_row()clanbite-social-kitWhether a user may delete a comment: its author, whoever manages the post it is on, or a site administrator (moderation).Data_Access::user_can_edit_comment_row()clanbite-social-kitWhether a user may edit a comment: its author.Reaction_Markup::picker()clanbite-social-kitThe reaction picker popover: one button per reaction type.Reaction_Markup::summary()clanbite-social-kitThe reaction chips for one object, each with a tooltip naming the reaction, its count and who reacted.Reactions::default_author()clanbite-social-kitA reactor as the browser needs it, when an object type supplies no author callback.Reactions::display_rows()clanbite-social-kitThe reaction chips for one object: every registered reaction with a count or the viewer's mark, then unknown slugs with counts.Reactions::enqueue_client()clanbite-social-kitLoad the shared reactions client (window.clanbite.reactions) for a surface that shows reactions.Reactions::get_object_type()clanbite-social-kitOne object type definition.Reactions::get_object_types()clanbite-social-kitAll registered object types (runs the registration action once).Reactions::icon_fields()clanbite-social-kitIcon fields shared by every reaction row: emoji, optional image and the hide_* flags the Interactivity bindings read.Reactions::my_reaction()clanbite-social-kitThe viewer's own reaction for the React button ("React" until they react, then their emoji and its name).Reactions::register_object_type()clanbite-social-kitRegister a reactable object type.Reactions::register_rest_routes()clanbite-social-kitRegister the shared REST route.Reactions::register()clanbite-social-kitHook the REST route.Reactions::rest_toggle()clanbite-social-kitREST: toggle a reaction ({ "reaction_type": "like" }).Reactions::toggle()clanbite-social-kitToggle a reaction on any registered object.Reactions::ui_state()clanbite-social-kitEverything the reaction UI shows for one object: the chips with counts and reactors, the viewer's own reaction and flags.Rest_Controller::delete_comment()clanbite-social-kitDelete a comment and the replies below it: its author, the post's manager or a site administrator.Rest_Controller::reactor_author()clanbite-social-kitA reactor as the feed describes any author (shared reactions service callback).Rest_Controller::update_comment()clanbite-social-kitEdit a comment ({ "content": "…" }): its author only.Rest_Controller::viewer_can_view_post()clanbite-social-kitWhether a viewer may read a post, by ID (used by the shared reactions service for posts and comments).Social_Kit::avatar_html()clanbite-social-kitMarkup for a player, team or group avatar, built by Clanbite core's shared avatar component.Social_Kit::filter_group_display_avatar()clanbite-social-kitTell core's avatar component where a group's avatar lives (core ships no groups).
REST API 2
clanbite-social-kit/v1/comments/(?P\d+)clanbite-social-kitclanbite-social-kit/v1/reactions/(?P[a-z0-9_-]+)/(?P\d+)clanbite-social-kit