Clanbite Since 1.5.0
clanbite_register_message( string $key, array $args ): voidRegister a customisable message.
A message is a short piece of wording the site owner may want to change: a notification title, a popup, the text of an automatic post. Register it with its default and the placeholders you will fill in, then build the text with clanbite_get_message() instead of a hard-coded __() string. Site owners edit it under the **Messages** sub-tab of the extension's settings tab (see clanbite_message_group_extensions()); an empty field keeps your default.
Call this on or after init (so __() already has its translations), or add the definition through the clanbite_message_definitions filter, which is evaluated lazily.
Parameters
$key(string) RequiredUnique key, lowercase with an area prefix:
team_invite.title. Letters, numbers,_and one.between parts.$args(array<string, mixed>) RequiredMessage definition.
$labelstringRequired. Short name shown above the field.$defaultstringRequired. Default wording, with{placeholder}tokens.$groupstringGroup slug fromclanbite_message_groups(). Defaultgeneral.$descriptionstringWhere the message appears (one sentence).$placeholdersarray<string, string>Token name => what it contains, for the placeholders$defaultmay use.$multilineboolUse a multi-line field (default false).
Returns
void
Defined in inc/messages.php
Changelog
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |