I want to change the menu button on my main nav bar depending if the user is or isn't a member of a group.
I need one button to 'register' if the user isn't part of a group and that same button changes to 'add post' if he/she is.
I do not know what to put in the array. Do I put an IF statement similar to "Correct way to use hook_menu_alter"?
function change_menu_menu_alter(&$items) {
$items['/node/[nid]'] = array(
'access callback' => 'change_menu_custom_menu_access_callback',
'access arguments' => array(1),
// **I don't know what goes here!!!**
);
return $items;
}
function change_menu_custom_menu_access_callback($gid) {
return og_is_member('node', $gid);
}
EDIT: I do not have gid in my url as I am using pathauto to use [node:content-type]/[node:title] on my URL which is why I don't think the current answer works on my website.