You are here

function user_preprocess_block in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/user/user.module \user_preprocess_block()
  2. 9 core/modules/user/user.module \user_preprocess_block()

Implements hook_preprocess_HOOK() for block templates.

File

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

Code

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