You are here

function hook_social_user_account_header_account_links in Open Social 8.4

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
  2. 8.5 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
  3. 8.6 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
  4. 8.7 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
  5. 8.8 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
  6. 10.3.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
  7. 10.0.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
  8. 10.1.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
  9. 10.2.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()

Allows a module to provide links for the user menu item.

Parameters

array $context: The context that was provided to the block rendering these links.

Return value

array Items in this array will be used as list items in a dropdown list. All returned items will be sorted using Element::children.

See also

\template_preprocess_item_list()

8 functions implement hook_social_user_account_header_account_links()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

social_activity_social_user_account_header_account_links in modules/social_features/social_activity/social_activity.module
Implements hook_social_user_account_header_account_links().
social_event_social_user_account_header_account_links in modules/social_features/social_event/social_event.module
Implements hook_social_user_account_header_account_links().
social_follow_content_social_user_account_header_account_links in modules/social_features/social_follow_content/social_follow_content.module
Implements hook_social_user_account_header_account_links().
social_group_social_user_account_header_account_links in modules/social_features/social_group/social_group.module
Implements hook_social_user_account_header_account_links().
social_private_message_social_user_account_header_account_links in modules/social_features/social_private_message/social_private_message.module
Implements hook_social_user_account_header_account_links().

... See full list

1 invocation of hook_social_user_account_header_account_links()
AccountHeaderBlock::build in modules/social_features/social_user/src/Plugin/Block/AccountHeaderBlock.php
Builds and returns the renderable array for this block plugin.

File

modules/social_features/social_user/social_user.api.php, line 72
Hooks provided by the Social_user module.

Code

function hook_social_user_account_header_account_links(array $context) {

  // Provides a vertical divider and a logout link for the user.
  return [
    'divider_logout' => [
      "#wrapper_attributes" => [
        "class" => [
          "divider",
        ],
        "role" => "separator",
      ],
      '#weight' => 1400,
    ],
    'logout' => [
      '#type' => 'link',
      '#attributes' => [
        'title' => new TranslatableMarkup("Logout"),
      ],
      '#url' => Url::fromRoute('user.logout'),
      '#title' => new TranslatableMarkup("Logout"),
      '#weight' => 1500,
    ],
  ];
}