Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. system.module

function system_preprocess_toolbar

Implements hook_preprocess_toolbar().

Related topics

Authorized operations
Functions to run operations with elevated privileges via authorize.php.

File

core/modules/system/system.module, line 476

Code

function system_preprocess_toolbar(array &$variables, $hook, $info) : void {
    // When Claro is the admin theme, Claro overrides the active theme's if that
    // active theme is not Claro. Because of these potential overrides, the
    // toolbar cache should be invalidated any time the default or admin theme
    // changes.
    $variables['#cache']['tags'][] = 'config:system.theme';
    // If Claro is the admin theme but not the active theme, still include Claro's
    // toolbar preprocessing.
    if (_system_is_claro_admin_and_not_active()) {
        require_once DRUPAL_ROOT . '/core/themes/claro/claro.theme';
        claro_preprocess_toolbar($variables, $hook, $info);
    }
}
RSS feed
Powered by Drupal