function onlyone_menu_links_discovered_alter in Allow a content type only once (Only One) 8
Implements hook_menu_links_discovered_alter().
File
- ./
onlyone.module, line 94 - Contains onlyone.module.
Code
function onlyone_menu_links_discovered_alter(&$links) {
// Adding the menu link if the new menu entry option is active.
if (\Drupal::config('onlyone.settings')
->get('onlyone_new_menu_entry')) {
$links['onlyone.add_page'] = [
'title' => t('Add content (Only One)'),
'route_name' => 'onlyone.add_page',
'menu_name' => 'admin',
'parent' => 'system.admin_content',
'description' => t('Add content page for content types configured to have Only One node per language.'),
];
}
}