Classes 2
Mention_Pickerclanbite-social-kitLoads assets/js/clanbite-mentions-picker.js for signed-in members when @mentions are on.Messages_SettingsclanbiteCustom wording stored in Messages_Settings::OPTION_KEY, keyed by clanbite_message_field_id().
Functions 21
clanbite_attach_toast_config()clanbiteHand the site's toast settings to the browser, as an inline script printed before clanbite-toasts.js.clanbite_core_message_definitions()clanbiteMessages written by core Clanbite (teams, events, the player settings screen).clanbite_enqueue_toasts()clanbiteLoad the toast library on this page.clanbite_format_message()clanbiteReplace {placeholder} tokens in a template.clanbite_get_message_default()clanbiteWording a message ships with, ignoring anything the site owner saved.clanbite_get_message_definitions()clanbiteRegistered messages, normalised.clanbite_get_message_template()clanbiteThe wording a message uses: the site owner's version, or the default.clanbite_get_message()clanbiteBuild a message: the site's wording with the placeholders filled in.clanbite_get_toast_config_script()clanbiteInline script that hands the site's toast settings to the browser, printed before clanbite-toasts.js.clanbite_get_toast_settings()clanbiteValidated toast settings (Clanbite → Settings → Notifications → Popups).clanbite_message_field_id()clanbiteSettings field id for a message key (the option array key: the dot becomes a hyphen, which a message key cannot contain, so ids never collide).clanbite_message_group_extensions()clanbiteWhich extension each message group belongs to.clanbite_message_groups()clanbiteAreas the messages are grouped under: one per extension, shown on that extension's Messages sub-tab.clanbite_register_message()clanbiteRegister a customisable message.clanbite_social_kit_enqueue_mention_picker()clanbite-social-kitLoad the @mention picker (script and style) on the current page for signed-in members.clanbite_social_kit_notify_mentions()clanbite-social-kitNotify the members @mentioned in content outside the feed.clanbite_social_kit_render_mentions()clanbite-social-kitTurn @username in content into profile links, honouring each member's "who can @mention me" setting.clanbite_toast_custom_duration_range()clanbiteShortest and longest length, in seconds, the site owner can type into the "Custom" length field.clanbite_toast_durations()clanbiteHow long a toast stays on screen by default.clanbite_toast_positions()clanbiteScreen positions a toast can appear in.clanbite_toasts_available()clanbiteWhether popups can appear on this site at all.
Hooks 21
clanbite_messageclanbiteFilters a finished message.clanbite_message_definitionsclanbiteFilters the registered messages (see clanbite_register_message() for the shape of each entry).clanbite_message_group_extensionsclanbiteFilters which extension's settings tab lists each message group.clanbite_message_groupsclanbiteFilters the groups messages are listed under (one per extension; see clanbite_message_group_extensions).clanbite_message_templateclanbiteFilters a message's wording before its placeholders are filled in.clanbite_social_kit_mention_picker_selectorsclanbite-social-kitFilters the CSS selectors of fields that get the @mention picker.clanbite_toast_configclanbiteFilters the configuration object sent to the browser as window.clanbiteToastConfig.clanbite_toast_custom_duration_rangeclanbiteFilters the range allowed for a custom popup length (Settings → Notifications → Popups).clanbite_toast_durationsclanbiteFilters how long a toast can stay on screen (the choices in Settings → Notifications → Popups).clanbite_toast_positionsclanbiteFilters the screen positions a toast can appear in (the choices in Settings → Notifications → Popups).clanbite_toast_settingsclanbiteFilters the toast settings before they are used (PHP) and sent to the browser (clanbiteToastConfig).clanbite_toasts_availableclanbiteFilters whether popups are available (Notifications is on and "Show popups" is not switched off).clanbite.mentions.selectorsclanbite-social-kitFilters the selector list of fields that get the @mention picker.clanbite.toasts.allowedUrlclanbiteFilters whether a URL may be used in a toast (icon image or action link).clanbite.toasts.containerclanbiteFilters the element the toast stacks are added to (default document.body).clanbite.toasts.dismissedclanbiteFires after a toast is dismissed.clanbite.toasts.elementclanbiteLets a handler build the toast element itself (custom markup).clanbite.toasts.payloadclanbiteFilters a toast's options before it is shown.clanbite.toasts.settingsclanbiteFilters the site-wide popup settings for one toast, after the server's values are applied.clanbite.toasts.shouldShowclanbiteFilters whether a toast is shown. Return false to suppress it.clanbite.toasts.shownclanbiteFires after a toast is on screen.
Messages 21
event_invite.messageclanbiteThe line under the title of an event invitation.event_invite.titleclanbiteSent when someone invites you to an event: a manager asking members to confirm, or a player inviting friends.group_event.messageclanbiteThe line under the title of a new group event.group_event.titleclanbiteSent to group members when a manager posts a group event.mention.message_genericclanbite-social-kitThe line under the title when someone mentions a member outside the feed, for example in a forum topic or reply.notification_bell.action_failedclanbitePopup shown when a button on a notification (Accept, Decline, …) fails and the server gave no reason.player_settings.bad_urlclanbitePopup shown when the page cannot work out where to save.player_settings.network_errorclanbitePopup shown when the save request could not reach the server.player_settings.save_failedclanbitePopup shown when the server rejects the save.player_settings.savedclanbitePopup shown after a member saves their profile settings.team_challenge.accept_successclanbitePopup shown after a challenge is accepted.team_challenge.decline_successclanbitePopup shown after a challenge is declined.team_challenge.messageclanbiteThe line under the title of a challenge notification.team_challenge.titleclanbiteSent to the challenged team’s admins.team_event.messageclanbiteThe line under the title of a new team event.team_event.titleclanbiteSent to the roster when a manager posts a team event.team_invite.accept_successclanbitePopup shown after a member accepts the invitation.team_invite.decline_successclanbitePopup shown after a member declines the invitation.team_invite.titleclanbiteSent to a member when they are invited to a team.team_match_event.messageclanbiteThe line under the title of the new match notification.team_match_event.titleclanbiteSent to every team member when an accepted challenge creates a match event.
Methods 18
Admin_Rest::add_messages_sub_tabs()clanbiteGive each tab a **Messages** sub-tab holding the wording of the extensions it covers.Admin::sanitize_toast_duration_custom()clanbiteSanitize the custom popup length: whole seconds within clanbite_toast_custom_duration_range().Admin::sanitize_toast_duration()clanbiteSanitize the popup length: one of the offered values (seconds, custom or 0 = until closed), otherwise the default.Admin::sanitize_toast_position()clanbiteSanitize the popup position: one of the known positions, otherwise the default.Mention_Picker::enqueue()clanbite-social-kitEnqueue the picker for the current member (nothing for visitors or when @mentions are off).Mention_Picker::maybe_enqueue()clanbite-social-kitPrint the picker on pages that show the social feed or composer.Mention_Picker::register_assets()clanbite-social-kitRegister the script and style (not yet printed).Mention_Picker::register()clanbite-social-kitRegister hooks.Mentions::author_may_mention()clanbite-social-kitWhether an author may @mention a member, by that member's privacy setting (Anyone, Friends, No one).Mentions::notify_content_mentions()clanbite-social-kitNotify the members @mentioned in content that lives outside the feed (forums, for example).Messages_Settings::export_rest_schema_for_groups()clanbiteREST schema (sections and fields) for some message groups only.Messages_Settings::get_defaults()clanbiteEvery message starts empty (= the registered default).Messages_Settings::get_menu_title()clanbiteMenu title for the legacy standalone settings page (if enabled).Messages_Settings::get_page_title()clanbiteBrowser title for the legacy standalone settings page (if enabled).Messages_Settings::get_sections()clanbiteOne section per message group, one field per registered message.Messages_Settings::render_page()clanbiteRender the classic PHP settings page shell (submenu mode only).Messages_Settings::sanitize_message()clanbiteSanitize a custom message: plain text, no markup, a sensible length.Messages_Settings::save_from_input()clanbiteSave only the messages that were sent, on top of what is already stored.
Settings 1
clanbite_messages_settingsclanbite