¡Hola, amigos! I’m Señor FAQ, the mustached maestro of questions and answers! With my trusty glasses and a book of endless wisdom, I turn dudas into solutions. Soy el héroe de los curiosos and the champion of clarity.
on_profile_sidebar_links
The on_profile_sidebar_links
hook allows developers to dynamically add or modify links
displayed in the user profile sidebar. This is particularly useful for integrating custom functionality,
such as links to marketplace features, support, or other plugins. This hook needs to be used in combination with the on_profile_tab_content hook.
$links = [
[
'id' => 'profile-basic',
'href' => $profile,
'icon' => 'fas fa-user fa-fw me-2',
'label' => $this->lang['my_profile'],
'class' => 'active',
'is_tab' => true
]
];
$additionalLinks = DynamicHooks::executeHook('on_profile_sidebar_links', true);
if (!empty($additionalLinks) && is_array($additionalLinks)) {
$links = array_merge($links, $additionalLinks);
}
This hook aggregates custom sidebar links and merges them with default links in the profile sidebar.
DynamicHooks::addHook('on_profile_sidebar_links', function () use ($jkv, $lang) {
return [
[
'id' => 'mp-support',
'href' => DynamicRewrite::parseUrl($jkv['slugforsiteprofile'], 'mp-support'),
'icon' => 'fas fa-life-ring fa-fw me-2',
'label' => $lang['marketplace_profile_support'],
'class' => '',
'is_tab' => true
],
[
'id' => 'mp-purchases',
'href' => DynamicRewrite::parseUrl($jkv['slugforsiteprofile'], 'mp-purchases'),
'icon' => 'fas fa-shopping-bag fa-fw me-2',
'label' => $lang['marketplace_profile_purchase'],
'class' => '',
'is_tab' => true
]
];
}, 'your_plugin');
id
to avoid conflicts.href
, label
).