By nkoporec on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
11.1.x
Introduced in version:
11.1.2
Issue links:
Description:
We added the ability to alter the main menu links that ships with Open Social. Developers can add/remove links via a new hook hook_social_core_default_main_menu_links_alter()
An example of how to add a new link:
/**
* Implements hook_social_core_default_main_menu_links_alter().
*/
function hook_social_core_default_main_menu_links_alter(array &$links) {
$link = \Drupal::entityTypeManager()->getStorage('menu_link_content')
->loadByProperties([
'title' => 'Community',
'menu_name' => 'main',
'link' => 'internal:/explore',
]);
$link = end($link);
$links[] = $link;
}
Impacts:
Site templates, recipes and distribution developers