Make a menu access to logged in users only

Public

Simple and Straight :)

Get raw version
php
  1. // Replace your menu path with "your_menu_path"
  2. function mymodulename_menu_alter(&$items) {
  3. $items['your_menu_path']['access callback'] = 'user_is_logged_in';
  4. }

Comments

carks's picture

it would be better like that :)

  1. function MYMODULE_menu_alter(&$items) {
ooops's picture

thanks @carks I did'n notice it before adding, I have chaged it.
thanks again :)

lelizondo's picture

It's not required to return anything on _alter functions

ooops's picture

Yes, its not required I have removed it thanks @lelizondo