I have a menu item:
$items['login-now'] = array
(
'title' => 'Log In',
'page callback' => 'some_or_other_method',
'access callback' => 'the_permissions_function',
'menu_name' => 'menu-ecommerce-nav',
'type' => MENU_NORMAL_ITEM,
'weight' => '5',
);
And then I have:
function the_permissions_function {
$isAnonymousUser = user_is_anonymous();
if (!$isAnonymousUser) {
return FALSE;
}
return TRUE;
}
This works if I am logged out. I can see the "log in" button. But when I log in, it STILL shows this login button. Why?
What's interesting is, I added this above the "return false"
print 'xxxx'; die();
And it hits this code!! But for some reason, it still shows the menu item? Why is it not hiding the menu item?
UPDATE
Even if I just do this:
'access callback' => 'user_is_anonymous',
It STILL shows the "log in" menu item when I am LOGGED in. Why on earth is it doing this? What am I missing?