You are here

function hook_social_user_account_header_links in Open Social 8.3

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
  2. 8.2 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
  3. 8.4 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
  4. 8.5 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
  5. 8.6 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
  6. 8.7 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
  7. 8.8 modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
  8. 10.3.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
  9. 10.0.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
  10. 10.1.x modules/social_features/social_user/social_user.api.php \hook_social_user_account_header_links()
  11. 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.
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().

File

modules/social_features/social_user/social_user.api.php, line 30
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',
    ],
  ];
}