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

Breadcrumb

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

function user_preprocess_block

Implements hook_preprocess_HOOK() for block templates.

File

core/modules/user/user.module, line 118

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal