¡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_tab_content
The on_profile_tab_content
hook enables developers to inject custom tab content dynamically into user profile sections.
This hook is ideal for adding personalized features, such as support tickets, purchased items, and other profile-related content. This hook needs to be used in combination with the on_profile_sidebar_links hook.
DynamicShortcode::register('jscms_profile_tab_content', function () {
$contents = DynamicHooks::executeHook('on_profile_tab_content', true);
$output = '';
foreach ($contents as $content) {
$output .= '<div class="tab-pane fade" id="' . htmlspecialchars($content['id']) . '" role="tabpanel" aria-labelledby="' . htmlspecialchars($content['id']) . '-tab">';
if (isset($content['callback']) && is_callable($content['callback'])) {
$output .= call_user_func($content['callback']);
} else {
$output .= $content['content'] ?? '';
}
$output .= '</div>';
}
return $output;
});
DynamicHooks::addHook('on_profile_tab_content', function () use ($jakdb, $jkv, $lang, $page1, $userGroupId) {
$userId = JSCMS_USERID;
$marketplaceProfile = new DynamicMarketplaceProfile($jakdb, $jkv, $lang, $userGroupId);
return [
[
'id' => 'mp-support',
'content' => $marketplaceProfile->renderSupportTab($userId),
],
[
'id' => 'mp-purchases',
'content' => $marketplaceProfile->renderPurchasesTab($userId, $page1),
]
];
}, 'your_plugin');