You are here

function hook_social_user_account_header_create_links in Open Social 8.9

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

Allows a module to provide links for the create content 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()

6 functions implement hook_social_user_account_header_create_links()

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

social_book_social_user_account_header_create_links in modules/social_features/social_book/social_book.module
Implements hook_social_user_account_header_create_links().
social_event_social_user_account_header_create_links in modules/social_features/social_event/social_event.module
Implements hook_social_user_account_header_create_links().
social_group_social_user_account_header_create_links in modules/social_features/social_group/social_group.module
Implements hook_social_user_account_header_create_links().
social_landing_page_social_user_account_header_create_links in modules/social_features/social_landing_page/social_landing_page.module
Implements hook_social_user_account_header_create_links().
social_page_social_user_account_header_create_links in modules/social_features/social_page/social_page.module
Implements hook_social_user_account_header_create_links().

... See full list

1 invocation of hook_social_user_account_header_create_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 29
Hooks provided by the Social_user module.

Code

function hook_social_user_account_header_create_links(array $context) {

  // Add a link to create a new page.
  return [
    'add_page' => [
      '#type' => 'link',
      '#attributes' => [
        'title' => new TranslatableMarkup('Create New Page'),
      ],
      '#url' => Url::fromRoute('node.add', [
        'node_type' => 'page',
      ]),
      '#title' => new TranslatableMarkup('New Page'),
      '#weight' => 300,
    ],
  ];
}