function user_preprocess_block

Implements hook_preprocess_HOOK() for block.html.twig.

File

drupal/core/modules/user/user.module, line 663
Enables the user registration and login system.

Code

function user_preprocess_block(&$variables) {
  if ($variables['configuration']['module'] == 'user') {
    switch ($variables['elements']['#plugin_id']) {
      case 'user_login_block':
        $variables['attributes']['role'] = 'form';
        break;
      case 'user_new_block':
        $variables['attributes']['role'] = 'complementary';
        break;
      case 'user_online_block':
        $variables['attributes']['role'] = 'complementary';
        break;
    }
  }
}