How to customize user tabs in member's area

From aMember Pro Documentation
Revision as of 12:56, 19 September 2012 by Unsable (talk | contribs) (Spelling, wording, grammar.)
Jump to: navigation, search

Let's say you want to add a tab to the member's area and remove the Add/Renew tab.

Add this code to /amember/application/configs/site.php:

Am_Di::getInstance()->hook->add('userMenu', 'siteUserMenu');
function siteUserMenu(Am_Event $event)
      // $user = $event->getUser(); // if required
      $menu = $event->getMenu();
      // eg; add a tab
              'id' => 'mypage',
              'label' => ___('Do The Thing'),
              'uri' => '/the.thing',
              'order' => 2,
       // remove a page
       $page = $menu->findOneBy('id', 'add-renew');