0

How would I unset this menu item: Content > Add Content > Article

I would like to programmatically disable that path-page (node/add/article), or even better use that path for another page. I tried using hook_menu_alter(&$items). Does not work for that path, while on others custom menu items that I created using hook_menu it does work.

Update: This is simple code that I tried (unset the $item key):

mymodule_hook_menu_alter(&$items) {
     unset($items['node/add/article'])
}
2
  • hook_menu_alter should do the trick -- could you show us the code you tried?
    – anschauung
    Commented Jul 31, 2013 at 20:03
  • Hi anschauung, I thought so as well... I updated the question with code example
    – Dev7
    Commented Jul 31, 2013 at 20:16

1 Answer 1

0

Admin menu is an yet another menu, which builds programmatically. So you can modify items using hooks registered for any menus.

If you would like to disallow atricle creation by specified role, just remove appropriate permission.

If this does not helps, look at admin_menu_menu_alter() and theme_admin_menu_links().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.