function hook_social_user_account_header_links in Open Social 8.5
Same name and namespace in other branches
- 8.9 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
- 8.2 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
- 8.3 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
- 8.4 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
- 8.6 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
- 8.7 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
- 8.8 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
- 10.3.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
- 10.0.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
- 10.1.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
- 10.2.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
Provide a method to create additional items from the user menu.
Return value
array An associative array of items from profile section of user menu. The keys of array elements are keys of menu items. Each array elements should have the following records:
- title: The text of menu item.
- url: Url object for a URL that has a Drupal route.
- after: Existing element after which will be added new item.
- divider: (optional) "before" for set divider over item and "after" for set divider under item.
Deprecated
This method is replaced by hook_social_user_account_header_account_links for greater flexibility.
See also
hook_social_user_account_header_account_links()
\Drupal\social_user\Plugin\Block\AccountHeaderBlock
1 function implements hook_social_user_account_header_links()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- social_gdpr_social_user_account_header_links in modules/
custom/ social_gdpr/ social_gdpr.module - Implements hook_social_user_account_header_links().
1 invocation of hook_social_user_account_header_links()
- social_user_social_user_account_header_account_links_alter in modules/
social_features/ social_user/ social_user.module - Implements hook_social_user_account_header_account_links_alter().
File
- modules/
social_features/ social_user/ social_user.api.php, line 178 - Hooks provided by the Social_user module.
Code
function hook_social_user_account_header_links() {
return [
'logout' => [
'title' => t('Delete account'),
'url' => Url::fromRoute('entity.user.cancel_form', [
'user' => \Drupal::currentUser(),
]),
'after' => 'edit_profile',
'divider' => 'after',
],
];
}