function social_topic_social_user_account_header_create_links in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_topic/social_topic.module \social_topic_social_user_account_header_create_links()
- 8.4 modules/social_features/social_topic/social_topic.module \social_topic_social_user_account_header_create_links()
- 8.5 modules/social_features/social_topic/social_topic.module \social_topic_social_user_account_header_create_links()
- 8.6 modules/social_features/social_topic/social_topic.module \social_topic_social_user_account_header_create_links()
- 8.7 modules/social_features/social_topic/social_topic.module \social_topic_social_user_account_header_create_links()
- 8.8 modules/social_features/social_topic/social_topic.module \social_topic_social_user_account_header_create_links()
- 10.3.x modules/social_features/social_topic/social_topic.module \social_topic_social_user_account_header_create_links()
- 10.0.x modules/social_features/social_topic/social_topic.module \social_topic_social_user_account_header_create_links()
- 10.2.x modules/social_features/social_topic/social_topic.module \social_topic_social_user_account_header_create_links()
Implements hook_social_user_account_header_create_links().
Adds the "Create Topic" link to the content creation menu.
File
- modules/
social_features/ social_topic/ social_topic.module, line 196 - The Social topic module.
Code
function social_topic_social_user_account_header_create_links($context) {
return [
'add_topic' => [
'#type' => 'link',
'#attributes' => [
'title' => new TranslatableMarkup('Create New Topic'),
],
'#title' => new TranslatableMarkup('New Topic'),
'#weight' => 200,
] + Url::fromRoute('node.add', [
'node_type' => 'topic',
])
->toRenderArray(),
];
}