Difference between revisions of "How to add/remove link in "Useful Links" block"

From aMember Pro Documentation
Jump to: navigation, search
(No difference)

Revision as of 10:30, 24 October 2016

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 $event){
    $event->addReturn('LINK TITLE', '/url/');

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)