kimaai_chatbot_theme

Deprecated since 1.6.0

Use kimaai_chatbot_theme_vars instead. It will be removed in 1.8.0.

When it fires

Right after kimaai_chatbot_theme_vars, once per colour mode, while the widget’s style is built. It still works, and WordPress gives its deprecation notice when a callback is hooked to it. Move to kimaai_chatbot_theme_vars: it reaches every colour of the widget and knows the colour mode.

The six keys come from the current theme’s colours, so a callback that returns them unchanged changes nothing. When it changes any of them, KimaAI sets the stylesheet’s older properties from all six, --kimaai-chatbot-primary and the --kimaai-chatbot-*-override properties for the text, the body, the header and the two kinds of message, in both colour modes; they win over the theme’s own colours.

Parameters

NameTypeDescription
themearrayThe six colours, bodyBgColor, bodyTextColor, userMessageBgColor, userMessageTextColor, aiMessageBgColor and aiMessageTextColor, derived from the current theme.

Returns

array: The six colours to use.

Example

add_filter(
  'kimaai_chatbot_theme',
  function (array $theme): array {
    $theme['bodyBgColor'] = '#14213d';
    $theme['bodyTextColor'] = '#ffffff';

    return $theme;
  }
);

More examples

The same with kimaai_chatbot_theme_vars, which also gives the dark pages their own colour:

add_filter(
  'kimaai_chatbot_theme_vars',
  function (array $vars, array $theme, array $appearance, array $look, string $scheme): array {
    $vars['--kimaai-w-header-bg'] = $scheme === 'dark' ? '#1e3a5f' : '#14213d';
    $vars['--kimaai-w-header-text'] = '#ffffff';

    return $vars;
  },
  10,
  5
);
  • kimaai_chatbot_theme_vars: the replacement.

What are your feelings