Add / remove link in Useful Links block
In order to create own link - add this code to site.php file:
Am_Di::getInstance()->hook->add(Am_Event::GET_MEMBER_LINKS, function (Am_Event $e){
//simple way to add link with url and label
$e->addReturn('LINK TITLE', '/url/');
$e->addReturn('LINK TITLE 2', '/url2/');
//also you can pass any desired attributes to <a> tag:
$e->addReturn([
'label' => 'LINK TITLE 3',
'href' => '/url3/',
'target' => '_blank',
'class' => 'my-link',
'style' => 'color:red; font-weight:bold',
]);
});
In order to remove link use this code (example is to remove Payment History link):
Am_Di::getInstance()->hook->add(Am_Event::GET_MEMBER_LINKS, function(Am_Event $e){
$ret = $e->getReturn();
foreach($ret as $k=>$v) {
if(strpos($k, 'payment-history')!==false) {
unset($ret[$k]);
}
}
$e->setReturn($ret);
});