In my module I need to install custom menu items (add to existing main-menu
) on the front-end side. So basically it's a simple one-time operation, yet it rises some questions about the proper way to deal with programatic menu items in general.
hook_install
+menu_link_save
sounds good for installing the items,hook_uninstall
+menu_link_delete
- for uninstalling, but how am I supposed to find out the$mlid
parameter of the menu link - required by themenu_link_delete
function?Would
hook_enable
andhook_disable
be more suitable?How do I protect my module's menu items from deleting on the admin UI side?