function hook_social_user_account_header_account_links in Open Social 10.2.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
- 8.4 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
- 8.5 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
- 8.6 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
- 8.7 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
- 8.8 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
- 10.3.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
- 10.0.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_account_links()
- 10.1.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()
11 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_album_social_user_account_header_account_links in modules/
social_features/ social_album/ social_album.module - Implements hook_social_user_account_header_account_links().
- social_core_social_user_account_header_account_links in modules/
social_features/ social_core/ social_core.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().
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 73 - 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,
],
];
}